class Repository implements ObjectRepository (View source)

Properties

protected $manager
protected $className

Methods

__construct(string $className, Manager $manager)

Instantiates a new repository.

method
__call(string $method, array $arguments)

Convenient method that intercepts the findBy() calls.

object
find($rid, $fetchPlan = '*:0')

Finds an object by its primary key / identifier.

mixed
findAll()

Finds all objects in the repository.

mixed
findBy(array $criteria, array $orderBy = array(), $limit = null, $offset = null, $fetchPlan = '*:0')

Finds objects by a set of criteria.

object
findOneBy(array $criteria)

Finds a single object by a set of criteria.

string
getClassName()

Returns the POPO class associated with this repository.

boolean
contains(object $document)

Verifies if the $document should belog to this repository.

getManager()

Returns the manager associated with this repository.

Array
getOrientClasses()

Returns the OrientDB classes which are mapper by the Repository's $className.

Details

__construct(string $className, Manager $manager)

Instantiates a new repository.

Parameters

string $className type
Manager $manager

method __call(string $method, array $arguments)

Convenient method that intercepts the findBy() calls.

Parameters

string $method
array $arguments

Return Value

method

Exceptions

RuntimeException

object find($rid, $fetchPlan = '*:0')

Finds an object by its primary key / identifier.

Parameters

$rid
$fetchPlan

Return Value

object The object.

mixed findAll()

Finds all objects in the repository.

Return Value

mixed The objects.

mixed findBy(array $criteria, array $orderBy = array(), $limit = null, $offset = null, $fetchPlan = '*:0')

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.

Parameters

array $criteria
array $orderBy
$limit
$offset
$fetchPlan

Return Value

mixed The objects.

object findOneBy(array $criteria)

Finds a single object by a set of criteria.

Parameters

array $criteria

Return Value

object The object.

string getClassName()

Returns the POPO class associated with this repository.

Return Value

string

protected boolean contains(object $document)

Verifies if the $document should belog to this repository.

Parameters

object $document

Return Value

boolean

protected Manager getManager()

Returns the manager associated with this repository.

Return Value

Manager

protected Array getOrientClasses()

Returns the OrientDB classes which are mapper by the Repository's $className.

Return Value

Array