Exemplo n.º 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);
         }
     }
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function add($documents, $preserveKeys = false)
 {
     parent::add($documents, $preserveKeys);
     if ($this->_root) {
         foreach ($this->getAdd() as $key => $document) {
             $document->setRootAndPath($this->_root, $this->_path . '._add' . $key);
         }
     }
 }
Exemplo n.º 3
0
 /**
  * Constructor.
  *
  * @param string                             $documentClass The document class.
  * @param Mandango\Document\AbstractDocument $parent The parent document.
  * @param string                             $field  The reference field.
  *
  * @api
  */
 public function __construct($documentClass, $parent, $field)
 {
     parent::__construct($documentClass);
     Archive::set($this, 'parent', $parent);
     Archive::set($this, 'field', $field);
 }