PHP Class Neos\Flow\Persistence\Doctrine\Repository

Inheritance: extends Doctrine\ORM\EntityRepository, implements Neos\Flow\Persistence\RepositoryInterface
Mostrar archivo Open project: neos/flow-development-collection

Protected Properties

Property Type Description
$defaultOrderings array
$objectType string Warning: if you think you want to set this, look at RepositoryInterface::ENTITY_CLASSNAME first!
$persistenceManager Neos\Flow\Persistence\PersistenceManagerInterface

Public Methods

Method Description
__call ( string $method, array $arguments ) : mixed Magic call method for repository methods.
__construct ( Doctrine\Common\Persistence\ObjectManager $entityManager, Doctrine\Common\Persistence\Mapping\ClassMetadata $classMetadata = null ) Initializes a new Repository.
add ( object $object ) : void Adds an object to this repository.
countAll ( ) : integer Counts all objects of this repository
createDqlQuery ( string $dqlString ) : Doctrine\ORM\Query Creates a DQL query from the given query string
createQuery ( ) : Query Returns a query for objects of this repository
findAll ( ) : Neos\Flow\Persistence\QueryResultInterface Finds all entities in the repository.
findByIdentifier ( mixed $identifier ) : object Finds an object matching the given identifier.
getEntityClassName ( ) : string Returns the classname of the entities this repository is managing.
remove ( object $object ) : void Removes an object from this repository.
removeAll ( ) : void Removes all objects of this repository as if remove() was called for all of them.
setDefaultOrderings ( array $defaultOrderings ) : void Sets the property names to order results by. Expected like this: array( 'foo' => \Neos\Flow\Persistence\QueryInterface::ORDER_ASCENDING, 'bar' => \Neos\Flow\Persistence\QueryInterface::ORDER_DESCENDING )
update ( object $object ) : void Schedules a modified object for persistence.

Method Details

__call() public method

Provides three methods - findBy($value, $caseSensitive = TRUE, $cacheResult = FALSE) - findOneBy($value, $caseSensitive = TRUE, $cacheResult = FALSE) - countBy($value, $caseSensitive = TRUE)
public __call ( string $method, array $arguments ) : mixed
$method string Name of the method
$arguments array The arguments
return mixed The result of the repository method

__construct() public method

Initializes a new Repository.
public __construct ( Doctrine\Common\Persistence\ObjectManager $entityManager, Doctrine\Common\Persistence\Mapping\ClassMetadata $classMetadata = null )
$entityManager Doctrine\Common\Persistence\ObjectManager The EntityManager to use.
$classMetadata Doctrine\Common\Persistence\Mapping\ClassMetadata The class descriptor.

add() public method

Adds an object to this repository.
public add ( object $object ) : void
$object object The object to add
return void

countAll() public method

Counts all objects of this repository
public countAll ( ) : integer
return integer

createDqlQuery() public method

Creates a DQL query from the given query string
public createDqlQuery ( string $dqlString ) : Doctrine\ORM\Query
$dqlString string The query string
return Doctrine\ORM\Query The DQL query object

createQuery() public method

Returns a query for objects of this repository
public createQuery ( ) : Query
return Query

findAll() public method

Finds all entities in the repository.
public findAll ( ) : Neos\Flow\Persistence\QueryResultInterface
return Neos\Flow\Persistence\QueryResultInterface The query result

findByIdentifier() public method

Finds an object matching the given identifier.
public findByIdentifier ( mixed $identifier ) : object
$identifier mixed The identifier of the object to find
return object The matching object if found, otherwise NULL

getEntityClassName() public method

Returns the classname of the entities this repository is managing.
public getEntityClassName ( ) : string
return string

remove() public method

Removes an object from this repository.
public remove ( object $object ) : void
$object object The object to remove
return void

removeAll() public method

Removes all objects of this repository as if remove() was called for all of them.
public removeAll ( ) : void
return void

setDefaultOrderings() public method

Sets the property names to order results by. Expected like this: array( 'foo' => \Neos\Flow\Persistence\QueryInterface::ORDER_ASCENDING, 'bar' => \Neos\Flow\Persistence\QueryInterface::ORDER_DESCENDING )
public setDefaultOrderings ( array $defaultOrderings ) : void
$defaultOrderings array The property names to order by by default
return void

update() public method

Schedules a modified object for persistence.
public update ( object $object ) : void
$object object The modified object
return void

Property Details

$defaultOrderings protected_oe property

protected array $defaultOrderings
return array

$objectType protected_oe property

Warning: if you think you want to set this, look at RepositoryInterface::ENTITY_CLASSNAME first!
protected string $objectType
return string

$persistenceManager protected_oe property

protected PersistenceManagerInterface,Neos\Flow\Persistence $persistenceManager
return Neos\Flow\Persistence\PersistenceManagerInterface