PHP Interface Doctrine\Common\Persistence\ObjectRepository

Since: 2.1
Author: Benjamin Eberlei ([email protected])
Author: Jonathan Wage ([email protected])
ファイルを表示 Open project: doctrine/common Interface Usage Examples

Public Methods

Method Description
find ( mixed $id ) : object | null Finds an object by its primary key / identifier.
findAll ( ) : array Finds all objects in the repository.
findBy ( array $criteria, array $orderBy = null, integer | null $limit = null, integer | null $offset = null ) : array Finds objects by a set of criteria.
findOneBy ( array $criteria ) : object | null Finds a single object by a set of criteria.
getClassName ( ) : string Returns the class name of the object managed by the repository.

Method Details

find() public method

Finds an object by its primary key / identifier.
public find ( mixed $id ) : object | null
$id mixed The identifier.
return object | null The object.

findAll() public method

Finds all objects in the repository.
public findAll ( ) : array
return array The objects.

findBy() public method

Optionally sorting and limiting details can be passed. An implementation may throw an UnexpectedValueException if certain values of the sorting or limiting details are not supported.
public findBy ( array $criteria, array $orderBy = null, integer | null $limit = null, integer | null $offset = null ) : array
$criteria array
$orderBy array
$limit integer | null
$offset integer | null
return array The objects.

findOneBy() public method

Finds a single object by a set of criteria.
public findOneBy ( array $criteria ) : object | null
$criteria array The criteria.
return object | null The object.

getClassName() public method

Returns the class name of the object managed by the repository.
public getClassName ( ) : string
return string