Returns a list of all the entities.

@param array $options
@param integer $hydrationMode
@return array
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);
    }
524536
public static function getList(array $options = array())
    {
        $api = new Api\GetService();
        $result = $api->doRequest();
        $paymentMethods = self::reorderOutput($result);

        if (isset($options['country'])) {
            $paymentMethods = self::filterCountry($paymentMethods, $options['country']);
        }

        return $paymentMethods;
    }
1043922
public static function hydrateCollection(array $modifications)
    {
        $hydrated = [];

        foreach ($modifications as $modification) {
            $hydrated[] = self::hydrate($modification);
        }

        return $hydrated;
    }
691919
public function getSearchOptions($table, string $field, array $options = []) : array
    {
        $handler = self::getByTableField($table, $field, $options, $this->cakeView);

        return $handler->getSearchOptions($options);
    }
674470
public function setCustomHydrationModes($modes)
    {
        $this->_attributes['customHydrationModes'] = array();

        foreach ($modes as $modeName => $hydrator) {
            $this->addCustomHydrationMode($modeName, $hydrator);
        }
    }
612499
public function getList(array $options = array())
    {
        $uri = $this->buildListResourceUri($this->listId);
        $response = $this->makeApiRequest($uri, $options);
        return $response->list;
    }
41818
public function getActiveDomains($mode = AbstractQuery::HYDRATE_OBJECT, $siteType = null)
    {
        $query = $this->getEntityManager()
            ->createQueryBuilder()
            ->select('e')
            ->from($this->getEntity(), 'e')
            ->where('e.isActive = :active')
            ->setParameters(
                [
                    ':active' => 1,
                ]
            );

        if ($siteType) {
            $query->andWhere('e.siteType = :siteType')
                ->setParameter(':siteType', $siteType);
        } else {
            $query->orderBy('e.siteType');
        }

        return $query->getQuery()->getResult($mode);
    }
776763
private function getMutationQueryParams($options = [])
    {
        $query = ['returnIds' => 'true'];

        if (!isset($options['returnDocuments']) || $options['returnDocuments']) {
            $query['returnDocuments'] = 'true';
        }

        if (isset($options['visibility']) && $options['visibility'] !== 'sync') {
            $query['visibility'] = $options['visibility'];
        }

        return $query;
    }
1366454
public function query(array $where, array $options = []) {
        $options += [
            'order' => $this->getDefaultOrder(),
            'limit' => $this->getDefaultLimit(),
            Db::OPTION_FETCH_MODE => $this->getFetchArgs()
        ];

        $stmt = $this->db->get($this->name, $where, $options);
        return $stmt;
    }
351181
protected function _getNoCascadeItems($entity, $options)
    {
        $noCascade = [];
        foreach ($this->_items as $assoc) {
            if (!$assoc->getCascadeCallbacks()) {
                $noCascade[] = $assoc;
                continue;
            }
            $assoc->cascadeDelete($entity, $options);
        }

        return $noCascade;
    }
91386
public function getGenericResources($limit = 10, $mode = AbstractQuery::HYDRATE_OBJECT)
    {
        $builder = $this->getEntityManager()->createQueryBuilder();

        $builder->select('e')
            ->from($this->getEntity(), 'e')
            ->where('e.isGeneric = 1')
            ->setMaxResults($limit);

        $query = LocaleAwareTrait::addHints($builder->getQuery());

        return $query->execute($mode);
    }
1222025
public static function getAllRecords($options = [])
    {
        $options = Util::prepareOptions($options, [
            'indexField' => false,
            'order' => false,
            'limit' => false,
            'calcFoundRows' => false,
            'offset' => 0,
        ]);

        $query = 'SELECT '.($options['calcFoundRows'] ? 'SQL_CALC_FOUND_ROWS' : '').'* FROM `%s`';
        $params = [
            static::$tableName,
        ];

        if ($options['order']) {
            $query .= ' ORDER BY ' . join(',', static::_mapFieldOrder($options['order']));
        }

        if ($options['limit']) {
            $query .= sprintf(' LIMIT %u,%u', $options['offset'], $options['limit']);
        }

        if ($options['indexField']) {
            return DB::table(static::_cn($options['indexField']), $query, $params, null, [static::class,'handleError']);
        } else {
            return DB::allRecords($query, $params, [static::class,'handleError']);
        }
    }
1034305
protected function entityToArray(UserEntityInterface $entity, HydratorInterface $hydrator = null)
    {
        if (!$hydrator) {
            $hydrator = $this->getHydrator();
        }

        return $hydrator->extract($entity);
    }
439941
protected function hydrator(): Hydrates
    {
        if (isset($this->decisionKey)) {
            return $this->choiceHydrator();
        }
        $mapped = Mapper::forThe($this->class);
        foreach ($this->properties as $property => $instruction) {
            $mapped = $mapped->property($property, $instruction);
        }
        return $mapped->finish();
    }
1142815
public static function countries($longlist = false, $hydrate = false)
    {
        $list = $longlist ? 'longlist' : 'shortlist';

        if (! isset(static::$countries[$list])) {
            static::$countries[$list] = json_decode(static::getFile(__DIR__.'/../resources/data/'.$list.'.json'), true);
        }

        return $hydrate ? array_map(function ($country) {
            return new Country($country);
        }, static::$countries[$list]) : static::$countries[$list];
    }
569849
public static function find( $where = 'all', $options = array() )
	{

		$dbr = wfGetDB( DB_SLAVE );

		if ( !is_array( $where ) && $where == 'all' ) {

			/* Fetch all entities */
			$collection = $dbr->select( static::$table,
				'id',
				array(),
				__METHOD__,
				$options
			);

		} else {

			/* Fetch conditional entities */
			$collection = $dbr->select( static::$table,
				'id',
				$where,
				__METHOD__,
				$options
			);

		}

		/* Check result */
		if ( !$collection ) return array();

		/* Generate array of entities for return */
		$entities = array();
		foreach ( $collection as $row ) {

			/* Create entity */
			$modelClass = get_called_class();
			$entity = new $modelClass($row->id);

			$entities[] = $entity;

		}

		if ( !count( $entities ) ) return array();

		return $entities;

	}
1274851
public function getOptionsList(array $entities = []) {
    $options = [];

    if (!empty($entities)) {
      foreach ($entities as $entity) {
        $entity = explode('-', $entity);
        $entity_type = $entity[0];
        $bundle = $entity[1];
        // Get all entity condition plugin definitions.
        foreach ($this->getDefinitions() as $plugin_id => $plugin_definition) {
          if (!empty($entity)) {
            if (isset($plugin_definition['entities'][$entity_type])) {
              // If only entity type is set in plugin.
              if (empty($plugin_definition['entities'][$entity_type])) {
                $options[$plugin_id] = Html::escape($plugin_definition['label']);
              }
              // If entity type and bundle(s) are set in plugin.
              else {
                if (in_array($bundle, $plugin_definition['entities'][$entity_type])) {
                  $options[$plugin_id] = Html::escape($plugin_definition['label']);
                }
              }
            }
          }
          else {
            $options[$plugin_id] = Html::escape($plugin_definition['label']);
          }
        }
      }
    }

    return $options;
  }