‪TYPO3CMS  9.5
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)
 
mixed getIdentifierByObject ($object)
 
object getObjectByIdentifier ($identifier, $objectType=null, $useLazyLoading=false)
 
int getObjectCountByQuery (QueryInterface $query)
 
array getObjectDataByQuery (QueryInterface $query)
 
 registerRepositoryClassName ($className)
 
 add ($object)
 
 remove ($object)
 
 update ($object)
 
 injectSettings (array $settings)
 
array convertObjectToIdentityArray ($object)
 
array convertObjectsToIdentityArrays (array $array)
 
QueryInterface createQueryForType ($type)
 

Detailed Description

The Extbase Persistence Manager interface

Definition at line 20 of file PersistenceManagerInterface.php.

Member Function Documentation

◆ add()

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

Adds an object to the persistence.

Parameters
object$object‪The object to add

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

◆ 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.

◆ convertObjectsToIdentityArrays()

array TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface::convertObjectsToIdentityArrays ( array  $array)

Recursively iterates through the given array and turns objects into arrays containing the identity of the domain object.

Parameters
array$array‪The array to be iterated over
Returns
‪array The modified array without objects
Exceptions

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

◆ convertObjectToIdentityArray()

array TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface::convertObjectToIdentityArray (   $object)

Converts the given object into an array containing the identity of the domain object.

Parameters
object$object‪The object to be converted
Returns
‪array The identity array in the format array('__identity' => '...')
Exceptions

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

◆ createQueryForType()

QueryInterface TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface::createQueryForType (   $type)

Return a query object for the given type.

Parameters
string$type
Returns
QueryInterface

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

◆ getIdentifierByObject()

mixed TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface::getIdentifierByObject (   $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
‪mixed The identifier for the object if it is known, or NULL

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

◆ getObjectByIdentifier()

object TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface::getObjectByIdentifier (   $identifier,
  $objectType = null,
  $useLazyLoading = false 
)

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

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

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

◆ getObjectCountByQuery()

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

Returns the number of records matching the query.

Parameters
QueryInterface$query
Returns
‪int
Deprecated:
‪since Extbase 6.0, will be removed in Extbase 7.0. It is deprecated only in the interface to be more in sync with Flow in future and will stay in Generic Persistence.

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

◆ getObjectDataByQuery()

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

Returns the object data matching the $query.

Parameters
QueryInterface$query
Returns
‪array
Deprecated:
‪since Extbase 6.0, will be removed in Extbase 7.0. It is deprecated only in the interface to be more in sync with Flow in future and will stay in Generic Persistence.

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

◆ injectSettings()

TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface::injectSettings ( array  $settings)

Injects the Extbase settings, called by Extbase.

Parameters
array$settings

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

◆ isNewObject()

bool TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface::isNewObject (   $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 (   $className)

Registers a repository

Parameters
string$className‪The class name of the repository to be registered
Deprecated:
‪since Extbase 6.0, will be removed in Extbase 7.0. It is deprecated only in the interface to be more in sync with Flow in future and will stay in Generic Persistence.

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

◆ remove()

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

Removes an object to the persistence.

Parameters
object$object‪The object to remove

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

◆ update()

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

Update an object in the persistence.

Parameters
object$object‪The modified object
Exceptions

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