コード例 #1
0
ファイル: Document.php プロジェクト: alexukua/opus4
 /**
  * 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());
     }
 }