Doctrine\ODM\PHPCR\UnitOfWork::scheduleInsert PHP Method

scheduleInsert() public method

Schedule insertion of this document and cascade if necessary.
public scheduleInsert ( object $document )
$document object
    public function scheduleInsert($document)
    {
        $visited = array();
        $this->doScheduleInsert($document, $visited);
    }

Usage Example

Example #1
0
 /**
  * {@inheritDoc}
  *
  * No PHPCR node will be created yet, this only happens on flush.
  *
  * For translatable documents has to determine the locale:
  *
  *   - If there is a non-empty Locale mapping that field value is used
  *   - If the document was previously loaded from the DocumentManager it
  *      has a non-empty Locale mapping
  *   - Otherwise its a new document. The language chooser strategy is asked
  *      for the default language and that is used to store. The field is
  *      updated with the locale.
  *
  * @param object $document the document to persist
  *
  * @throws InvalidArgumentException if $document is not an object.
  */
 public function persist($document)
 {
     if (!is_object($document)) {
         throw new InvalidArgumentException('Parameter $document needs to be an object, ' . gettype($document) . ' given');
     }
     $this->errorIfClosed();
     $this->unitOfWork->scheduleInsert($document);
 }
All Usage Examples Of Doctrine\ODM\PHPCR\UnitOfWork::scheduleInsert
UnitOfWork