Example #1
0
 /**
  * Persists an document as part of the current unit of work.
  *
  * @param object $document The document to persist.
  */
 public function persist($document)
 {
     $class = $this->dm->getClassMetadata(get_class($document));
     if ($class->isEmbeddedDocument || $class->isMappedSuperclass) {
         throw MongoDBException::cannotPersistEmbeddedDocumentOrMappedSuperclass($class->name);
     }
     $visited = array();
     $this->doPersist($document, $visited);
 }