Returns all of the stores that are suitable for the given mode and requirements.

@param int $mode One of cache_store::MODE_*
@param int $requirements The requirements of the cache as a binary flag
@return array An array of suitable stores.
334885
public function get_stores($mode, $requirements = 0) {
        $stores = array();
        foreach ($this->configstores as $name => $store) {
            // If the mode is supported and all of the requirements are provided features.
            if (($store['modes'] & $mode) && ($store['features'] & $requirements) === $requirements) {
                $stores[$name] = $store;
            }
        }
        return $stores;
    }
732815
private function getFetchConfig($mode, $fetchArgument = null, array $ctorArgs = [])
    {
        if ($this->fetchConfig) {
            return $this->fetchConfig;
        }

        return $this->createFetchConfig($mode, $fetchArgument, $ctorArgs);
    }
740257
public function setFetchMode($mode)
    {
        //check for PDO extension
        if (!extension_loaded('pdo')) {
            /**
             * @see Zend_Db_Adapter_Exception
             */
            // require_once 'Zend/Db/Adapter/Exception.php';
            throw new Zend_Db_Adapter_Exception('The PDO extension is required for this adapter but the extension is not loaded');
        }
        switch ($mode) {
            case PDO::FETCH_LAZY:
            case PDO::FETCH_ASSOC:
            case PDO::FETCH_NUM:
            case PDO::FETCH_BOTH:
            case PDO::FETCH_NAMED:
            case PDO::FETCH_OBJ:
                $this->_fetchMode = $mode;
                break;
            default:
                /**
                 * @see Zend_Db_Adapter_Exception
                 */
                // require_once 'Zend/Db/Adapter/Exception.php';
                throw new Zend_Db_Adapter_Exception("Invalid fetch mode '$mode' specified");
                break;
        }
    }
791024
public function where($requirements = [])
    {
        foreach ($requirements as $name => $args) {
            if (!isset($this->_chain[$name])) {
                throw new InvalidArgumentException("Unexisting `{$name}` as method as part of the chain definition.");
            }
            if (!is_array($args)) {
                throw new InvalidArgumentException("Argument requirements must be an arrays for `{$name}` method.");
            }
            call_user_func_array([$this->_chain[$name], 'with'], $args);
        }
        return $this;
    }
9190
public function getEntities(array $options = [], $hydrationMode = AbstractQuery::HYDRATE_OBJECT)
    {
        $options = EntityRepositoryOptionsResolver::createAndResolve($options);
        return $this->getQueryBuilder($options['filters'], $options['sorting'])
            ->getQuery()
            ->execute(null, $hydrationMode);
    }
1060161
protected function getListStore()
    {
        $id = $this->getParam(0);

        if (!isset($id)) {
            return $this->store->getList(array('limit' => $this->getLimit()));
        }

        if (!is_numeric($id)) {
            $this->errorAndExit($this->text('Invalid argument'));
        }

        $result = $this->store->get($id);

        if (empty($result)) {
            $this->errorAndExit($this->text('Unexpected result'));
        }

        return array($result);
    }
382584
public static function get_default_mode_stores() {
        global $OUTPUT;
        $instance = cache_config::instance();
        $adequatestores = cache_helper::get_stores_suitable_for_mode_default();
        $icon = new pix_icon('i/warning', new lang_string('inadequatestoreformapping', 'cache'));
        $storenames = array();
        foreach ($instance->get_all_stores() as $key => $store) {
            if (!empty($store['default'])) {
                $storenames[$key] = new lang_string('store_'.$key, 'cache');
            }
        }
        $modemappings = array(
            cache_store::MODE_APPLICATION => array(),
            cache_store::MODE_SESSION => array(),
            cache_store::MODE_REQUEST => array(),
        );
        foreach ($instance->get_mode_mappings() as $mapping) {
            $mode = $mapping['mode'];
            if (!array_key_exists($mode, $modemappings)) {
                debugging('Unknown mode in cache store mode mappings', DEBUG_DEVELOPER);
                continue;
            }
            if (array_key_exists($mapping['store'], $storenames)) {
                $modemappings[$mode][$mapping['store']] = $storenames[$mapping['store']];
            } else {
                $modemappings[$mode][$mapping['store']] = $mapping['store'];
            }
            if (!array_key_exists($mapping['store'], $adequatestores)) {
                $modemappings[$mode][$mapping['store']] = $modemappings[$mode][$mapping['store']].' '.$OUTPUT->render($icon);
            }
        }
        return $modemappings;
    }
111988
protected function getRequired($scope = 'Index', $method = Doozr_Http::REQUEST_METHOD_GET)
    {
        // prepare storage on method/verb level
        if (!isset($this->required[$method])) {
            return [];
        }

        // prepare storage on scope level
        if (!isset($this->required[$method][$scope])) {
            return [];
        }

        return $this->required[$method][$scope];
    }
161720
protected function getManyCatalogs(array $locale, $domain = null) {
		if ($domain === null) {
			return array_intersect_key(
				$this->catalogs,
				array_flip($locale)
			);
		}

		if (is_string($domain)) {
			$result = [];

			foreach ($locale as $part) {
				if (isset($this->catalogs[$part][$domain])) {
					$result[$part][$domain] = $this->catalogs[$part][$domain];
				}
			}

			return $result;
		}

		if (is_array($domain)) {
			$result = [];

			foreach ($locale as $part) {
				if (isset($this->catalogs[$part])) {
					$result[$part] = array_intersect_key(
						$this->catalogs[$part],
						array_flip($domain)
					);
				}
			}

			return $result;
		}

		throw new InvalidParameter('Domain must be a string or an array');
	}
1361643
public function get($mode = self::MODE_CURRENT_LEVEL) {

        $parameter = array();
        if ($mode === self::MODE_ALL_LEVELS) {
            $parameter['bubble'] = 'all';
        } else if ($mode === self::MODE_DISTINCT_NAMES) {
            $parameter['bubble'] = 'distinct';
        }
        $http = $this->send('GET', $parameter);
        if (!$http->ok) {
            $response = false;
        } else if ($this->simple) {
            $response = json_decode($http->response, true);
        } else if (isset($http->responseJson->{'@graph'})) {
            $response = array();
            foreach ($http->responseJson->{'@graph'} as $level) {
                $settings = json_decode(json_encode($level->custom), true);
                unset($settings['@id']);
                $response[self::$LEVEL_NAMES[$level->{'@type'}]] = $settings;
            }
        }

        return $response;

    }
332560
public function findRequirements($name)
    {
        $requirements = [];

        $module = $this->findOrFail($name);

        foreach ($module->getRequires() as $requirementName) {
            $requirements[] = $this->findByAlias($requirementName);
        }

        return $requirements;
    }
633121
private function getRecommendedProduct($productModel, $mode)
    {
        //array of products to display
        $products = [];
        switch ($mode) {
            case 'related':
                $products = $productModel->getRelatedProductIds();
                break;
            case 'upsell':
                $products = $productModel->getUpSellProductIds();
                break;
            case 'crosssell':
                $products = $productModel->getCrossSellProductIds();
                break;
        }

        return $products;
    }
1246016
def _get_cached_requirements(requirements, saltenv):
    '''
    
    '''

    req_file, senv = salt.utils.url.parse(requirements)
    if senv:
        saltenv = senv

    if req_file not in __salt__['cp.list_master'](saltenv):
        # Requirements file does not exist in the given saltenv.
        return False

    cached_requirements = __salt__['cp.is_cached'](
        requirements, saltenv
    )
    if not cached_requirements:
        # It's not cached, let's cache it.
        cached_requirements = __salt__['cp.cache_file'](
            requirements, saltenv
        )
    # Check if the master version has changed.
    if __salt__['cp.hash_file'](requirements, saltenv) != \
            __salt__['cp.hash_file'](cached_requirements, saltenv):
        cached_requirements = __salt__['cp.cache_file'](
            requirements, saltenv
        )

    return cached_requirements
945086
public function getMode($mode = 'list')
    {
        if ($this->getOrder()) {
            $website = $this->_storeManager
                ->getStore($this->getOrder()->getStoreId())
                ->getWebsite();
            $mode = $this->helper->getReviewDisplayType($website);
        }

        return $mode;
    }
1336387
public function fetchAll($mode = \PDO::FETCH_CLASS)
    {
        $rows = [];
        try {
            $rows = $this->sth->fetchAll($mode);
        } catch (\PDOException $e) {
            $this->errorInfo('', $e->getMessage());
            throw $e;
        }
        return $rows;
    }
988172
protected function getSingleCatalog($locale, $domain = null) {
		if (! isset($this->catalogs[$locale])) {
				 return [];
		}

		if ($domain === null) {
			return [$locale => $this->catalogs[$locale]];
		}

		if (is_string($domain)) {
			if (! isset($this->catalogs[$locale][$domain])) {
				return [];
			}

			return [
				$locale => [
					$domain => $this->catalogs[$locale][$domain]
				]
			];
		}

		if (is_array($domain)) {
			return [$locale => array_intersect_key(
				$this->catalogs[$locale],
				array_flip($domain))
			];
		}
		
		throw new InvalidParameter('Domain must be a string or an array');
	}
1145178
public function options(string $pattern, $callback, array $requirements = [])
    {
        return $this->match($pattern, $callback, $requirements, [Request::METHOD_OPTIONS]);
    }