class ObjectPathMappingRepository extends Repository (View source)

Repository for object path mapping objects

Constants

ENTITY_CLASSNAME

Properties

protected PersistenceManagerInterface $persistenceManager from  Repository
protected string $entityClassName

Warning: if you think you want to set this, look at RepositoryInterface::ENTITY_CLASSNAME first!

from  Repository
protected array $defaultOrderings
protected EntityManagerInterface $entityManager

Doctrine's Entity Manager.

Methods

__construct()

Initializes a new Repository.

string
getEntityClassName()

Returns the classname of the entities this repository is managing.

void
add(object $object)

Adds an object to this repository.

void
remove(object $object)

Removes an object from this repository.

findAll()

Returns all objects of this repository

object|null
findByIdentifier(mixed $identifier)

Finds an object matching the given identifier.

createQuery()

Returns a query for objects of this repository

int
countAll()

Counts all objects of this repository

void
removeAll()

Removes all objects of this repository as if remove() was called for all of them.

void
setDefaultOrderings(array $defaultOrderings)

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 )

void
update(object $object)

Schedules a modified object for persistence.

mixed
__call(string $method, array $arguments)

Magic call method for repository methods.

findOneByObjectTypeUriPatternAndPathSegment(string $objectType, string $uriPattern, string $pathSegment, bool $caseSensitive = false)

No description

findOneByObjectTypeUriPatternAndIdentifier(string $objectType, string $uriPattern, string|int $identifier)

No description

void
persistEntities()

Persists all entities managed by the repository and all cascading dependencies

Details

__construct()

Initializes a new Repository.

string getEntityClassName()

Returns the classname of the entities this repository is managing.

Note that anything that is an "instanceof" this class is accepted by the repository.

Return Value

string

void add(object $object)

Adds an object to this repository.

Parameters

object $object

The object to add

Return Value

void

Exceptions

IllegalObjectTypeException

void remove(object $object)

Removes an object from this repository.

Parameters

object $object

The object to remove

Return Value

void

Exceptions

IllegalObjectTypeException

QueryResultInterface findAll()

Returns all objects of this repository

Return Value

QueryResultInterface

The query result

See also

QueryInterface::execute

object|null findByIdentifier(mixed $identifier)

Finds an object matching the given identifier.

Parameters

mixed $identifier

The identifier of the object to find

Return Value

object|null

The matching object if found, otherwise NULL

QueryInterface createQuery()

Returns a query for objects of this repository

Return Value

QueryInterface

int countAll()

Counts all objects of this repository

Return Value

int

void removeAll()

Removes all objects of this repository as if remove() was called for all of them.

use DQL here, would be much more performant

Return Value

void

void setDefaultOrderings(array $defaultOrderings)

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 )

Parameters

array $defaultOrderings

The property names to order by by default

Return Value

void

void update(object $object)

Schedules a modified object for persistence.

Parameters

object $object

The modified object

Return Value

void

Exceptions

IllegalObjectTypeException

mixed __call(string $method, array $arguments)

Magic call method for repository methods.

Provides three methods

  • findBy($value, $caseSensitive = true, $cacheResult = false)
  • findOneBy($value, $caseSensitive = true, $cacheResult = false)
  • countBy($value, $caseSensitive = true)

Parameters

string $method

Name of the method

array $arguments

The arguments

Return Value

mixed

The result of the repository method

ObjectPathMapping|null findOneByObjectTypeUriPatternAndPathSegment(string $objectType, string $uriPattern, string $pathSegment, bool $caseSensitive = false)

No description

Parameters

string $objectType

the object type of the ObjectPathMapping object

string $uriPattern

the URI pattern of the ObjectPathMapping object

string $pathSegment

the URI path segment of the ObjectPathMapping object

bool $caseSensitive

whether the path segment lookup should be done case-sensitive

Return Value

ObjectPathMapping|null

ObjectPathMapping|null findOneByObjectTypeUriPatternAndIdentifier(string $objectType, string $uriPattern, string|int $identifier)

No description

Parameters

string $objectType

the object type of the ObjectPathMapping object

string $uriPattern

the URI pattern of the ObjectPathMapping object

string|int $identifier

the identifier of the object, for example the UUID, \Neos\Flow\Persistence\PersistenceManagerInterface::getIdentifierByObject()

Return Value

ObjectPathMapping|null

Exceptions

InvalidArgumentException

void persistEntities()

Persists all entities managed by the repository and all cascading dependencies

Return Value

void