PHP 인터페이스 Neos\Flow\Persistence\PersistenceManagerInterface

파일 보기 프로젝트 열기: neos/flow-development-collection 0 사용 예제들

공개 메소드들

메소드 설명
add ( object $object ) : void Adds an object to the persistence.
clearState ( ) : void Clears the in-memory state of the persistence.
convertObjectToIdentityArray ( object $object ) : array Converts the given object into an array containing the identity of the domain object.
convertObjectsToIdentityArrays ( array $array ) : array Recursively iterates through the given array and turns objects into arrays containing the identity of the domain object.
createQueryForType ( string $type ) : Neos\Flow\Persistence\QueryInterface Return a query object for the given type.
getIdentifierByObject ( object $object ) : mixed Returns the (internal) identifier for the object, if it is known to the backend. Otherwise NULL is returned.
getObjectByIdentifier ( mixed $identifier, string $objectType = null, boolean $useLazyLoading = false ) : object Returns the object with the (internal) identifier, if it is known to the backend. Otherwise NULL is returned.
hasUnpersistedChanges ( ) : boolean Gives feedback if the persistence Manager has unpersisted changes.
injectSettings ( array $settings ) : void Injects the Flow settings, called by Flow.
isConnected ( ) : boolean Returns TRUE, if an active connection to the persistence backend has been established, e.g. entities can be persisted.
isNewObject ( object $object ) : boolean Checks if the given object has ever been persisted.
persistAll ( boolean $onlyWhitelistedObjects = false ) : void Commits new objects and changes to objects in the current persistence session into the backend.
registerNewObject ( Aspect\PersistenceMagicInterface $object ) : void Registers an object which has been created or cloned during this request.
remove ( object $object ) : void Removes an object to the persistence.
update ( object $object ) : void Update an object in the persistence.
whitelistObject ( object $object ) : void Adds the given object to a whitelist of objects which may be persisted when persistAll() is called with the $onlyWhitelistedObjects flag. This is the case if "safe" HTTP request methods are used.

메소드 상세

add() 공개 메소드

Adds an object to the persistence.
public add ( object $object ) : void
$object object The object to add
리턴 void

clearState() 공개 메소드

Managed instances become detached, any fetches will return data directly from the persistence "backend".
public clearState ( ) : void
리턴 void

convertObjectToIdentityArray() 공개 메소드

Converts the given object into an array containing the identity of the domain object.
public convertObjectToIdentityArray ( object $object ) : array
$object object The object to be converted
리턴 array The identity array in the format array('__identity' => '...')

convertObjectsToIdentityArrays() 공개 메소드

Recursively iterates through the given array and turns objects into arrays containing the identity of the domain object.
또한 보기: convertObjectToIdentityArray()
public convertObjectsToIdentityArrays ( array $array ) : array
$array array The array to be iterated over
리턴 array The modified array without objects

createQueryForType() 공개 메소드

Return a query object for the given type.
public createQueryForType ( string $type ) : Neos\Flow\Persistence\QueryInterface
$type string
리턴 Neos\Flow\Persistence\QueryInterface

getIdentifierByObject() 공개 메소드

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.
public getIdentifierByObject ( object $object ) : mixed
$object object
리턴 mixed The identifier for the object if it is known, or NULL

getObjectByIdentifier() 공개 메소드

Returns the object with the (internal) identifier, if it is known to the backend. Otherwise NULL is returned.
public getObjectByIdentifier ( mixed $identifier, string $objectType = null, boolean $useLazyLoading = false ) : object
$identifier mixed
$objectType string
$useLazyLoading boolean Set to TRUE if you want to use lazy loading for this object
리턴 object The object for the identifier if it is known, or NULL

hasUnpersistedChanges() 공개 메소드

This is primarily used to inform the user if he tries to save data in an unsafe request.
public hasUnpersistedChanges ( ) : boolean
리턴 boolean

injectSettings() 공개 메소드

Injects the Flow settings, called by Flow.
public injectSettings ( array $settings ) : void
$settings array
리턴 void

isConnected() 공개 메소드

Returns TRUE, if an active connection to the persistence backend has been established, e.g. entities can be persisted.
public isConnected ( ) : boolean
리턴 boolean TRUE, if an connection has been established, FALSE if add object will not be persisted by the backend

isNewObject() 공개 메소드

Checks if the given object has ever been persisted.
public isNewObject ( object $object ) : boolean
$object object The object to check
리턴 boolean TRUE if the object is new, FALSE if the object exists in the repository

persistAll() 공개 메소드

If $onlyWhitelisteObjects is set to TRUE, only those objects which have been registered with whitelistObject() will be persisted. If other objects are in the queue, an exception will be raised.
public persistAll ( boolean $onlyWhitelistedObjects = false ) : void
$onlyWhitelistedObjects boolean
리턴 void

registerNewObject() 공개 메소드

The given object must contain the Persistence_Object_Identifier property, thus the PersistenceMagicInterface type hint. A "new" object does not necessarily have to be known by any repository or be persisted in the end. Objects registered with this method must be known to the getObjectByIdentifier() method.
public registerNewObject ( Aspect\PersistenceMagicInterface $object ) : void
$object Aspect\PersistenceMagicInterface The new object to register
리턴 void

remove() 공개 메소드

Removes an object to the persistence.
public remove ( object $object ) : void
$object object The object to remove
리턴 void

update() 공개 메소드

Update an object in the persistence.
public update ( object $object ) : void
$object object The modified object
리턴 void

whitelistObject() 공개 메소드

Adds the given object to a whitelist of objects which may be persisted when persistAll() is called with the $onlyWhitelistedObjects flag. This is the case if "safe" HTTP request methods are used.
public whitelistObject ( object $object ) : void
$object object The object
리턴 void