@param string $driveName  restricts results to volumes with the specified name
@param string $regionSlug restricts results to volumes available in a specific region

@return VolumeEntity[] Lists all of the Block Storage volumes available
333952
public function getByNameAndRegion($driveName, $regionSlug)
    {
        $volumes = $this->adapter->get(sprintf('%s/volumes?per_page=%d&region=%s&name=%s', $this->endpoint, 200, $regionSlug, $driveName));

        $volumes = json_decode($volumes);

        $this->extractMeta($volumes);

        return array_map(function ($volume) {
            return new VolumeEntity($volume);
        }, $volumes->volumes);
    }
128252
public function getCatalogs($locale = null, $domain = null) {
		$cache = $this->getCacheFrontend();
		
		if (is_array($locale)) {
			$catalogs = $cache->getMany($locale);
			
			return empty($catalogs) ? null : $catalogs;
		}
		
		$catalogs = $cache->get($locale);
		
		if ($catalogs === null) {
			return;
		}
		
		return [$locale => $catalogs];
	}
919171
public function &getBlocksByName($name)
    {
        if (!isset($this->namedBlocks[$name])) {
            $this->namedBlocks[$name] = [];
        }

        return $this->namedBlocks[$name];
    }
25494
protected function getSelectedQuestion($questionSlug = null)
    {
        $selectedQuestion = null;

        if ($questionSlug !== null) {
            $selectedQuestion = $this->getQuestionRepository()->findOneBySlug($questionSlug);
        }

        return $selectedQuestion;
    }
313778
public static function GetColumns(array $options, $table_name, $forced_obtain = false) {
		return static::GetConnection($options)->getColumns($table_name, $forced_obtain);
	}
1052431
public static function get_areas_names($tagcollid, $enabledonly = true) {
        $allitemtypes = core_tag_area::get_areas($tagcollid, $enabledonly);
        $itemtypes = array();
        foreach ($allitemtypes as $itemtype => $it) {
            foreach ($it as $component => $v) {
                $itemtypes[$v->id] = core_tag_area::display_name($component, $itemtype);
            }
        }
        return $itemtypes;
    }
579936
public function getContentTypeFromAlias($alias, $forceSlug = false)
    {
        foreach ($this->contenttypes->getData() as $key => $contenttype) {
            if ($forceSlug && $forceSlug === 'singular') {
                if (isset($contenttype['singular_slug']) && ($contenttype['slug'] === $alias || $contenttype['tablename'] === $alias)) {
                    return $contenttype['singular_slug'];
                }
            } elseif ($forceSlug) {
                if (isset($contenttype['slug']) && ($contenttype['slug'] === $alias || $contenttype['tablename'] === $alias)) {
                    return $contenttype['slug'];
                }
            }
            if (isset($contenttype['tablename']) && $contenttype['tablename'] === $alias) {
                return $key;
            }

            if (isset($contenttype['slug']) && $contenttype['slug'] === $alias) {
                return $key;
            }
        }

        return $alias;
    }
1210209
protected function getSlugFromName($name)
    {
        if( array_key_exists($name, self::$sluggedNames) ) {
            return self::$sluggedNames[$name];
        }

        return self::$sluggedNames[$name] = trim(Str::slug($name, '-'));
    }
122205
private function getRowCountsByArchiveName($statuses, $getRowSizeMethod, $forceCache = false,
                                               $otherSelects = array(), $otherDataTableColumns = array())
    {
        $extraCols = '';
        if (!empty($otherSelects)) {
            $extraCols = ', ' . implode(', ', $otherSelects);
        }

        $cols = array_merge(array('row_count'), $otherDataTableColumns);

        $dataTable = new DataTable();
        foreach ($statuses as $status) {
            $dataTableOptionName = $this->getCachedOptionName($status['Name'], 'byArchiveName');

            // if option exists && !$forceCache, use the cached data, otherwise create the
            $cachedData = Option::get($dataTableOptionName);
            if ($cachedData !== false && !$forceCache) {
                $table = DataTable::fromSerializedArray($cachedData);
            } else {
                $table = new DataTable();
                $table->addRowsFromSimpleArray($this->dataAccess->getRowCountsByArchiveName($status['Name'], $extraCols));

                $reduceArchiveRowName = array($this, 'reduceArchiveRowName');
                $table->filter('GroupBy', array('label', $reduceArchiveRowName));

                $serializedTables = $table->getSerialized();
                $serializedTable = reset($serializedTables);
                Option::set($dataTableOptionName, $serializedTable);
            }

            // add estimated_size column
            $getEstimatedSize = array($this, $getRowSizeMethod);
            $table->filter('ColumnCallbackAddColumn',
                array($cols, 'estimated_size', $getEstimatedSize, array($status)));

            $dataTable->addDataTable($table);
        }
        return $dataTable;
    }
381229
public function resize($id, $newSize, $regionSlug)
    {
        $data = [
            'type' => 'resize',
            'size_gigabytes' => $newSize,
            'region' => $regionSlug,
        ];

        $action = $this->adapter->post(sprintf('%s/volumes/%s/actions', $this->endpoint, $id), $data);

        $action = json_decode($action);

        return new ActionEntity($action->action);
    }
1118261
public function clear($regionName = null) {
        $path = $this->getPath($regionName);
        $result = count(glob($path . DIRECTORY_SEPARATOR . '*.cache'));

        array_map('unlink', glob($path . DIRECTORY_SEPARATOR . '*.cache'));
        array_map('unlink', glob($path . DIRECTORY_SEPARATOR . '*.policy'));

        return $result;
    }
966787
public function getWorkspacesByUserAndRoleNamesNotIn(
        User $user,
        array $roleNames,
        array $restrictionIds = null
    )
    {
        return $this->workspaceRepo->findByUserAndRoleNamesNotIn($user, $roleNames, $restrictionIds);
    }
88118
private function getItemBySource(MappingInterface $mapping, $sourceSlug)
    {
        if ($sourceSlug === $mapping->getLeftItem()->getSource()->getSlug()) {
            return $mapping->getLeftItem();
        }

        return $mapping->getRightItem();
    }
230126
public function getRegion($name)
    {
        if (!isset($this->regions[$name])) {
            $this->regions[$name] = new Region($name);
        }

        return $this->regions[$name];
    }
257531
public function getAllSubordinates($guid = null, $limit = CAKE_LDAP_SYNC_AD_LIMIT) {
		$result = [];
		$conditions = [];
		$contain = [];
		if (!empty($guid)) {
			$conditions[$this->Employee->alias . '.' . CAKE_LDAP_LDAP_ATTRIBUTE_OBJECT_GUID] = $guid;
			$contain[] = 'Employee';
		}
		$fields = [
			$this->alias . '.id',
			$this->alias . '.parent_id',
			$this->alias . '.lft',
			$this->alias . '.rght',
			$this->alias . '.name',
		];
		$order = [
			$this->alias . '.id' => 'asc',
		];
		$result = $this->find('all', compact('fields', 'conditions', 'order', 'limit', 'contain'));

		return $result;
	}
101222
public function getTermBySlug($termSlug)
    {
        $term = $this->getTermsBy('slug', $termSlug);

        return $term->first() ? $term->first() : null;
    }
850351
public function getSluggedFileName($name)
    {
        $fileNameExploded = explode(".", $name);
        $extension = array_pop($fileNameExploded);
        $fileNameExploded = implode(".", $fileNameExploded);

        return $this->slugify($fileNameExploded) . "." . $extension;
    }