Пример #1
0
 /**
  * {@inheritdoc}
  */
 public function add($documents)
 {
     parent::add($documents);
     if ($rap = $this->getRootAndPath()) {
         foreach ($this->getAdd() as $key => $document) {
             $document->setRootAndPath($rap['root'], $rap['path'] . '._add' . $key);
         }
     }
 }
Пример #2
0
 /**
  * Constructor.
  *
  * @param string                              $documentClass The document class.
  * @param \Mongator\Document\AbstractDocument $parent        The parent document.
  * @param string                              $field         The reference field.
  *
  * @api
  */
 public function __construct($documentClass, $parent, $field)
 {
     parent::__construct($documentClass);
     $this->getArchive()->set('parent', $parent);
     $this->getArchive()->set('field', $field);
 }