/** * Store all Opus_Collection objects for this document. * * @return void */ protected function _storeCollection($collections) { if (true === is_null($this->getId())) { return; } Opus_Collection::unlinkCollectionsByDocumentId($this->getId()); foreach ($collections as $collection) { if ($collection->isNewRecord()) { $collection->store(); } if ($collection->holdsDocumentById($this->getId())) { continue; } $collection->linkDocumentById($this->getId()); } }