‪TYPO3CMS  ‪main
TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface Interface Reference
Inheritance diagram for TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface:
TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager

Public Member Functions

 persistAll ()
 
 clearState ()
 
bool isNewObject (object $object)
 
string null getIdentifierByObject (object $object)
 
object null getObjectByIdentifier (string|int $identifier, ?string $objectType=null, bool $useLazyLoading=false)
 
 getObjectCountByQuery (QueryInterface $query)
 
 getObjectDataByQuery (QueryInterface $query)
 
 registerRepositoryClassName (string $className)
 
 add (object $object)
 
 remove (object $object)
 
 update (object $object)
 
QueryInterface< T > createQueryForType (string $type)
 

Detailed Description

The Extbase Persistence Manager interface

Definition at line 23 of file PersistenceManagerInterface.php.

Member Function Documentation

◆ add()

TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface::add ( object  $object)

Adds an object to the persistence.

Parameters
object$object‪The object to add

Implemented in TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager.

Referenced by TYPO3\CMS\Extbase\Tests\Unit\Persistence\RepositoryTest\addDelegatesToPersistenceManager().

◆ clearState()

TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface::clearState ( )

Clears the in-memory state of the persistence.

Managed instances become detached, any fetches will return data directly from the persistence "backend".

Implemented in TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager.

◆ createQueryForType()

QueryInterface<T> TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface::createQueryForType ( string  $type)

Return a query object for the given type.

only to be used within Extbase, not part of TYPO3 Core API@template T of object

Parameters
class-string<T>‪$type
Returns
‪QueryInterface<T>

Implemented in TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager.

◆ getIdentifierByObject()

string null TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface::getIdentifierByObject ( object  $object)

Returns the (internal) identifier for the object, if it is known to the backend. Otherwise NULL is returned.

Note: this returns an identifier even if the object has not been persisted in case of AOP-managed entities. Use isNewObject() if you need to distinguish those cases.

Parameters
object$object
Returns
‪string|null The identifier for the object if it is known, or NULL

Implemented in TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager.

◆ getObjectByIdentifier()

object null TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface::getObjectByIdentifier ( string|int  $identifier,
?string  $objectType = null,
bool  $useLazyLoading = false 
)

Returns the object with the (internal) identifier, if it is known to the backend. Otherwise NULL is returned.

Parameters
bool$useLazyLoading‪Set to TRUE if you want to use lazy loading for this object
Returns
‪object|null The object for the identifier if it is known, or NULL

Implemented in TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager.

◆ getObjectCountByQuery()

TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface::getObjectCountByQuery ( QueryInterface  $query)

Returns the number of records matching the query.

Implemented in TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager.

◆ getObjectDataByQuery()

TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface::getObjectDataByQuery ( QueryInterface  $query)

Returns the object data matching the $query.

Implemented in TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager.

◆ isNewObject()

bool TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface::isNewObject ( object  $object)

Checks if the given object has ever been persisted.

Parameters
object$object‪The object to check
Returns
‪bool TRUE if the object is new, FALSE if the object exists in the repository

Implemented in TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager.

◆ persistAll()

TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface::persistAll ( )

Commits new objects and changes to objects in the current persistence session into the backend

Implemented in TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager.

◆ registerRepositoryClassName()

TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface::registerRepositoryClassName ( string  $className)

Registers a repository

Parameters
string$className‪The class name of the repository to be registered

Implemented in TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager.

◆ remove()

TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface::remove ( object  $object)

Removes an object to the persistence.

Parameters
object$object‪The object to remove

Implemented in TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager.

Referenced by TYPO3\CMS\Extbase\Tests\Unit\Persistence\RepositoryTest\removeDelegatesToPersistenceManager().

◆ update()

TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface::update ( object  $object)

Update an object in the persistence.

Parameters
object$object‪The modified object
Exceptions

Implemented in TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager.

Referenced by TYPO3\CMS\Extbase\Tests\Unit\Persistence\RepositoryTest\updateDelegatesToPersistenceManager().