TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
PersistenceManagerInterface Interface Reference
Inheritance diagram for PersistenceManagerInterface:
PersistenceManager

Public Member Functions

 persistAll ()
 
 clearState ()
 
 isNewObject ($object)
 
 getIdentifierByObject ($object)
 
 getObjectByIdentifier ($identifier, $objectType=null, $useLazyLoading=false)
 
 getObjectCountByQuery (QueryInterface $query)
 
 getObjectDataByQuery (QueryInterface $query)
 
 registerRepositoryClassName ($className)
 
 add ($object)
 
 remove ($object)
 
 update ($object)
 
 injectSettings (array $settings)
 
 convertObjectToIdentityArray ($object)
 
 convertObjectsToIdentityArrays (array $array)
 
 createQueryForType ($type)
 

Detailed Description

The Extbase Persistence Manager interface

Definition at line 20 of file PersistenceManagerInterface.php.

Member Function Documentation

add (   $object)

Adds an object to the persistence.

Parameters
object$objectThe object to add
Returns
void

Implemented in PersistenceManager.

clearState ( )

Clears the in-memory state of the persistence.

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

Returns
void

Implemented in PersistenceManager.

convertObjectsToIdentityArrays ( array  $array)

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

Parameters
array$arrayThe array to be iterated over
Returns
array The modified array without objects
Exceptions
TYPO3 if array contains objects that are not known to the Persistence Manager
See also
convertObjectToIdentityArray()

Implemented in PersistenceManager.

convertObjectToIdentityArray (   $object)

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

Parameters
object$objectThe object to be converted
Returns
array The identity array in the format array('__identity' => '...')
Exceptions
TYPO3 if the given object is not known to the Persistence Manager

Implemented in PersistenceManager.

createQueryForType (   $type)

Return a query object for the given type.

Parameters
string$type
Returns
QueryInterface

Implemented in PersistenceManager.

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

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$useLazyLoadingSet 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 PersistenceManager.

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

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

injectSettings ( array  $settings)

Injects the Extbase settings, called by Extbase.

Parameters
array$settings
Returns
void

Implemented in PersistenceManager.

isNewObject (   $object)

Checks if the given object has ever been persisted.

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

Implemented in PersistenceManager.

persistAll ( )

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

Returns
void

Implemented in PersistenceManager.

registerRepositoryClassName (   $className)

Registers a repository

Parameters
string$classNameThe 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.
Returns
void

Implemented in PersistenceManager.

remove (   $object)

Removes an object to the persistence.

Parameters
object$objectThe object to remove
Returns
void

Implemented in PersistenceManager.

update (   $object)

Update an object in the persistence.

Parameters
object$objectThe modified object
Returns
void
Exceptions
TYPO3

Implemented in PersistenceManager.