main/app/Persistence/ObjectManager.php
public function findList($class, $property, array $list, $orderStrict = false)
    {
        if (0 === count($list)) {
            return [];
        }

        $dql = "SELECT object FROM {$class} object WHERE object.{$property} IN (:list)";
        $query = $this->wrapped->createQuery($dql);
        $query->setParameter('list', $list);
        $objects = $query->getResult();

        if (($entityCount = count($objects)) !== ($idCount = count($list))) {
            $this->monolog->warning("{$entityCount} out of {$idCount} ids don't match any existing object");
        }

        if ($orderStrict) {
            // Sort objects to have the same order as given $ids array
            $sortIds = array_flip($list);
            usort($objects, function ($a, $b) use ($sortIds) {
                return $sortIds[$a->getId()] - $sortIds[$b->getId()];
            });
        }

        return $objects;
    }
public function findList($class, $property, array $list, $orderStrict = false)
    {
        if (0 === count($list)) {
            return [];
        }

        $dql = "SELECT object FROM {$class} object WHERE object.{$property} IN (:list)";
        $query = $this->wrapped->createQuery($dql);
        $query->setParameter('list', $list);
        $objects = $query->getResult();

        if (($entityCount = count($objects)) !== ($idCount = count($list))) {
            $this->monolog->warning("{$entityCount} out of {$idCount} ids don't match any existing object");
        }

        if ($orderStrict) {
            // Sort objects to have the same order as given $ids array
            $sortIds = array_flip($list);
            usort($objects, function ($a, $b) use ($sortIds) {
                return $sortIds[$a->getId()] - $sortIds[$b->getId()];
            });
        }

        return $objects;
    }
public function findList ( $ class , $ property , array $ list , $ orderStrict = false ) { if ( 0 === count ( $ list ) ) { return [ ] ; } $ dql = "SELECT object FROM {$class} object WHERE object.{$property} IN (:list)" ; $ query = $ this -> wrapped -> createQuery ( $ dql ) ; $ query -> setParameter ( 'list' , $ list ) ; $ objects = $ query -> getResult ( ) ; if ( ( $ entityCount = count ( $ objects ) ) !== ( $ idCount = count ( $ list ) ) ) { $ this -> monolog -> warning ( "{$entityCount} out of {$idCount} ids don't match any existing object" ) ; } if ( $ orderStrict ) { // Sort objects to have the same order as given $ids array $ sortIds = array_flip ( $ list ) ; usort ( $ objects , function ( $ a , $ b ) use ( $ sortIds ) { return $ sortIds [ $ a -> getId ( ) ] - $ sortIds [ $ b -> getId ( ) ] ; } ) ; } return $ objects ; }
Finds a set of objects.

@param $class
@param $property
@param array $list
@param bool  $orderStrict keep the same order as ids array

@return array [object]

@throws MissingObjectException if any of the requested objects cannot be found

@internal param string $objectClass

@todo make this method compatible with odm implementations
Finds a set of objects .