/** * {@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); } } }
/** * {@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); } } }