Find multiple entities.

@return  CollectionFinderInterface  The responsible Finder object

@throws  OrmException  if there was an error getting the entities
344243
public function findAll()
    {
        $this->updateMap();

        return $this->entityRepository->findAll()->with('id', Operator::IN, $this->map);
    }
1124602
public function find($alias = null)
    {
        $finder = new EntityFinder($this->manager, $this->manager->getDriver(), $this);
        if ($alias !== null) {
            $finder->alias($alias);
        }

        return $finder;
    }
753993
public function findObject($entity, $_id)
	{
		$retValue = array();

		try{
			$m = new MongoDB\Driver\Manager($this->url);

			$id = new \MongoDB\BSON\ObjectId($_id);
			$filter = ['_id' => $id];
			$options = [];

			$query = new \MongoDB\Driver\Query($filter, $options);
			$mCol = $this->db . "."  . $entity;
			$jsonData = $m->executeQuery($mCol, $query);

			$retValue = $jsonData->toArray();
		}
		catch(Exception $e) {
			$this->_log->addError($e->getMessage());
		}

		return $retValue;
	}
577353
protected function get_collection_to() {
        if ($this->collectionto === null) {
            $this->collectionto = api::search_competencies('', $this->to);
        }
        return $this->collectionto;
    }
499648
public function findAll($name, $ordenColumn = null, $ordenType = null) {
        $this->load();
        $mapper = MapperBuilder::buildFromName($this->mapping, $name);

        $query = "SELECT * FROM `" . $mapper->getTable() . "` ";
        if (!is_null($ordenColumn)) {
            $query .= "ORDER BY $ordenColumn ";
            if (!is_null($ordenType)) {
                $query .= "$ordenType";
            } else {
                $query .= "ASC";
            }
        }
        $raw = $this->getDataSource()->query($query);
        if ($raw) {
            $collection = new Collection($mapper->getClass(), $raw, $mapper);
        } else {
            $collection = new Collection($mapper->getClass(), array(), $mapper);
        }
        return $collection;
    }
97140
public function findObject($entity, $_id)
	{
		$retValue = array();

		$query = array('_id' => $_id);

		if (! is_null($this->_conn)){
			$retValue = $this->_conn->select($entity, '*', $query);

			if ($this->error($this->_conn->error()))
				$retValue = array();
		}

		$retValue = array('data' => $retValue);

		return $retValue;
	}
556501
public function find() {
		//todo: check table exists
		$db = DBFactory::getDB($this->data['table']);
		$result = $db->find($this->data);
		$ret = new ModelArray();
		foreach ((array)$result as $row) {
			$model = new $this->modelClass();
			foreach ($row as $k => $v) {
				$model->setOriginalValue($k, $v);
			}
			$model->setNotNew();
			$ret[] = $model;
		}
		return $ret;
	}
150260
public function findObject($entity, $_id)
	{
		$retValue = array();

		try{
			$query = array('_id' => new MongoId($_id));

			if (! is_null($this->_db)){
				$mongo = $this->_db->selectCollection($entity);

				// Find Object
				$retValue = $mongo->findOne($query);

				if (is_null($retValue))
					$retValue = array();
			}
		}
		catch(Exception $e) {
			$this->_log->addError($e->getMessage());
		}

		return $retValue;
	}
1165348
public static function find($collection, $id)
    {
        $id = intval($id);
        foreach ($collection as $entity) {
            if ($id === $entity->getId()) {
                return $entity;
            }
        }

        return null;
    }
174956
public function findBy(array $criteria)
    {
        //Make sure there is a criteria
        if(count($criteria) == 0)
        {
            throw new Exception("Please supply at least one criteria to findBy().");
        }

        $collection = new ArrayCollection();

        //If this repository is for a node
        if($this->meta instanceof Node)
        {
            $query = $this->createIndexQuery($criteria);

            foreach($this->getIndex()->query($query) as $node)
            {
                $collection->add($this->entityManager->loadNode($node));
            }
        }

        //Is a relation
        elseif($this->meta instanceof Relation)
        {
            //Array of different results
            $result_sets = array();

            //Criteria to use for query
            $query_criteria = array();

            //Generate the query criteria
            foreach($criteria as $k => $v)
            {
                $key = Meta\Reflection::normalizeProperty($k);

                //If it's the start or end
                if($key == $this->meta->getStart()->getName() || $key == $this->meta->getEnd()->getName())
                {
                    //Load relation by node (null if the property isn't a start/end)
                    $result_sets[] = $this->getRelationsByNode($key, $v);
                }

                //Regular property, add to query criteria to run later
                else
                {
                    $query_criteria[$k] = $v;
                }
            }

            //Do the query
            if(count($query_criteria) > 0)
            {
                $query = $this->createIndexQuery($query_criteria);
                $result_sets[] = $this->getIndex()->query($query);
            }

            //Intersect the 3 potential result sets (if they are there)
            $results = count($result_sets) > 1 ? call_user_func_array('array_intersect', $result_sets) : $result_sets[0];

            foreach($results as $rel)
            {
                $collection->add($this->entityManager->loadRelation($rel));
            }
        }

        return $collection;
    }
1179304
public function findAll() {
    $dataConnection = $this->app->getDataConnection($this->connection);
    $foundObjects = $dataConnection->findAll($this->table, $this->readFields);
    $foundModels = array();
    if (is_array($foundObjects)) {
      foreach ($foundObjects as $foundObject) {
        /**
         * @var $model \MABI\Model
         */
        $model = call_user_func($this->modelClass . '::init', $this->app);
        $model->load($foundObject);
        $foundModels[] = $model;
      }
    }
    return $foundModels;
  }
468452
protected function loadEntity()
    {
        $params = array_merge($this->params()->fromPost(), $this->params()->fromRoute());
        if (empty($params['id'])) {
            throw new EntityNotFoundException('Bad Request');
        }

        $objectManager = $this->getServiceLocator()->get('Doctrine\ORM\EntityManager');

        if (!$model = $objectManager->getRepository(get_class($this->getEntity()))->find($params['id'])) {
            throw new EntityNotFoundException('Entity not found');
        }
        return $model;
    }
541962
private function getFinder(): \Iterator
    {
        return Finder::create()
            ->in($this->rootDir)
            ->ignoreUnreadableDirs()
            ->files()
            ->name('*.xlf')
            ->getIterator();
    }
600648
protected function _find($id, $options = [])
    {
        $defaults = [
            'query'        => [],
            'fetchOptions' => []
        ];
        $options += $defaults;

        $fetchOptions = $options['fetchOptions'];
        unset($options['fetchOptions']);

        if ($this->link() !== static::LINK_KEY) {
            throw new ORMException("This relation is not based on a foreign key.");
        }
        $to = $this->to();
        $schema = $to::definition();

        if (!$id) {
            return $to::create([], ['type' => 'set']);
        }

        $ids = is_array($id) ? $id : [$id];
        $key = $schema->key();
        $column = $schema->column($key);

        foreach ($ids as $i => $value) {
            $ids[$i] = $schema->convert('cast', $column['type'], $value, $column);
        }

        if (count($ids) === 1) {
            $ids = reset($ids);
        }
        $conditions = [$this->keys('to') => $ids];
        if ($this->conditions()) {
            $conditions = [
                ':and()' => [
                    [$this->keys('to') => $ids],
                    $this->conditions()
                ]
            ];
        }
        $query = Set::extend($options['query'], ['conditions' => $conditions]);
        return $to::all($query, $fetchOptions);
    }
631383
public static function findOneBy($collection, $fieldName, $searchValue, $default = null)
    {
        if (false === self::isValid($collection)) {
            return null;
        }

        $getter = sprintf('get%s', ucfirst($fieldName));
        foreach ($collection as $entity) {
            $function = [
                $entity,
                $getter
            ];

            if (false === is_callable($function)) {
                throw new LogicException('Missing getter');
            }

            if ($entity->$getter() === $searchValue) {
                return $entity;
            }
        }

        return $default;
    }
202735
public function findAll()
    {
        $query = $this->createQueryBuilder();
        //return $this->getResultFromQueryBuilder($query);

        $cacheDriver = new \Doctrine\Common\Cache\ArrayCache();
        if (!$cacheDriver->contains('cache_id')) {
            $array = $this->getResultFromQueryBuilder($query);
            $cacheDriver->save('my_array', $array);
        } else {
            $array = $cacheDriver->fetch('my_array');
        }
        return $array;
    }
1132642
public function find($collectionName, array $criteria = [], array $fields = []) {
		$collection = $this->getCollection($collectionName);
		
		if ($this->_profilerEnabled) {
			$message = 'db.' . $collectionName . '.find(';

			if (empty($criteria)) {
				$message .= ');';
			} else {
				$message .= json_encode($criteria) . ');';
			}

			$event = $this->getProfiler()->startRead($message);
		}

		$cursor = $collection->find($criteria, $fields);

		if ($this->_profilerEnabled) {
			$event->stopSuccess();
		}

		return $cursor;
	}