src/Repository.php
public function findPrimaries(array $primaryValues, array $associate = [])
    {
        $reflection = Entity\Reflection::load($this->getEntityName());

        if (!$reflection->hasPrimary()) {
            throw new Exception\RepositoryException(
                "Method can not be used because entity " . $this->getEntityName()
                . " has no primary property defined!"
            );
        }

        if (empty($primaryValues)) {
            throw new Exception\RepositoryException(
                "Values can not be empty!"
            );
        }

        try {

            return $this->query()
                ->select()
                ->setFilter(
                    [
                        $reflection->getPrimaryProperty()->getName() => [
                            Filter::EQUAL => $primaryValues
                        ]
                    ]
                )
                ->associate($associate)
                ->run($this->connection);
        } catch (Exception\QueryException $e) {
            throw new Exception\RepositoryException($e->getMessage());
        }
    }
public function findPrimaries(array $primaryValues, array $associate = [])
    {
        $reflection = Entity\Reflection::load($this->getEntityName());

        if (!$reflection->hasPrimary()) {
            throw new Exception\RepositoryException(
                "Method can not be used because entity " . $this->getEntityName()
                . " has no primary property defined!"
            );
        }

        if (empty($primaryValues)) {
            throw new Exception\RepositoryException(
                "Values can not be empty!"
            );
        }

        try {

            return $this->query()
                ->select()
                ->setFilter(
                    [
                        $reflection->getPrimaryProperty()->getName() => [
                            Filter::EQUAL => $primaryValues
                        ]
                    ]
                )
                ->associate($associate)
                ->run($this->connection);
        } catch (Exception\QueryException $e) {
            throw new Exception\RepositoryException($e->getMessage());
        }
    }
public function findPrimaries ( array $ primaryValues , array $ associate = [ ] ) { $ reflection = Entity \ Reflection :: load ( $ this -> getEntityName ( ) ) ; if ( ! $ reflection -> hasPrimary ( ) ) { throw new Exception \ RepositoryException ( "Method can not be used because entity " . $ this -> getEntityName ( ) . " has no primary property defined!" ) ; } if ( empty ( $ primaryValues ) ) { throw new Exception \ RepositoryException ( "Values can not be empty!" ) ; } try { return $ this -> query ( ) -> select ( ) -> setFilter ( [ $ reflection -> getPrimaryProperty ( ) -> getName ( ) => [ Filter :: EQUAL => $ primaryValues ] ] ) -> associate ( $ associate ) -> run ( $ this -> connection ) ; } catch ( Exception \ QueryException $ e ) { throw new Exception \ RepositoryException ( $ e -> getMessage ( ) ) ; } }
Find records by set of primary values

@param array $primaryValues
@param array $associate

@return Entity\Collection

@throws Exception\RepositoryException
Find records by set of primary values