. */ namespace Doctrine\Common\Persistence; /** * Contract for a Doctrine persistence layer ObjectRepository class to implement. * * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @link www.doctrine-project.org * @since 2.1 * @author Benjamin Eberlei * @author Jonathan Wage */ interface ObjectRepository { /** * Finds an object by its primary key / identifier. * * @param $id The identifier. * @return object The object. */ function find($id); /** * Finds all objects in the repository. * * @return mixed The objects. */ function findAll(); /** * Finds objects by a set of criteria. * * 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. * * @throws UnexpectedValueException * @param array $criteria * @param array|null $orderBy * @param int|null $limit * @param int|null $offset * @return mixed The objects. */ function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null); /** * Finds a single object by a set of criteria. * * @param array $criteria * @return object The object. */ function findOneBy(array $criteria); /** * Returns the class name of the object managed by the repository * * @return string */ function getClassName(); }