Neos\Flow\Persistence\PersistenceManagerInterface::persistAll PHP Méthode

persistAll() public méthode

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
Résultat void
    public function persistAll($onlyWhitelistedObjects = false);

Usage Example

 /**
  * Fetches the identifier from the set content object. If that
  * is not using automatically introduced UUIDs by Flow it tries
  * to call persistAll() and fetch the identifier again. If it still
  * fails, an exception is thrown.
  *
  * @return void
  * @throws IllegalObjectTypeException
  */
 protected function initializeObject()
 {
     if ($this->contentObject !== null) {
         $this->targetType = get_class($this->contentObject);
         $this->targetId = $this->persistenceManager->getIdentifierByObject($this->contentObject);
         if ($this->targetId === null) {
             $this->persistenceManager->persistAll();
             $this->targetId = $this->persistenceManager->getIdentifierByObject($this->contentObject);
             if ($this->targetId === null) {
                 throw new IllegalObjectTypeException('You cannot add an object without an identifier to a ContentObjectProxy. Probably you didn\'t add a valid entity?', 1303859434);
             }
         }
     }
 }
All Usage Examples Of Neos\Flow\Persistence\PersistenceManagerInterface::persistAll