interface ObjectRepository

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 <kontakt@beberlei.de> @author Jonathan Wage <jonwage@gmail.com>

Hierarchy

Expanded class hierarchy of ObjectRepository

All classes that implement ObjectRepository

File

drupal/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectRepository.php, line 31

Namespace

Doctrine\Common\Persistence
View source
interface ObjectRepository {

  /**
   * Finds an object by its primary key / identifier.
   *
   * @param int $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();

}

Members

Namesort descending Modifiers Type Description Overrides
ObjectRepository::find function Finds an object by its primary key / identifier.
ObjectRepository::findAll function Finds all objects in the repository.
ObjectRepository::findBy function Finds objects by a set of criteria.
ObjectRepository::findOneBy function Finds a single object by a set of criteria.
ObjectRepository::getClassName function Returns the class name of the object managed by the repository