コード例 #1
0
ファイル: BaseFileForm.class.php プロジェクト: EQ4/smint
 public function saveCollectionFileList($con = null)
 {
     if (!$this->isValid()) {
         throw $this->getErrorSchema();
     }
     if (!isset($this->widgetSchema['collection_file_list'])) {
         // somebody has unset this widget
         return;
     }
     if (null === $con) {
         $con = $this->getConnection();
     }
     $c = new Criteria();
     $c->add(CollectionFilePeer::FILE_ID, $this->object->getPrimaryKey());
     CollectionFilePeer::doDelete($c, $con);
     $values = $this->getValue('collection_file_list');
     if (is_array($values)) {
         foreach ($values as $value) {
             $obj = new CollectionFile();
             $obj->setFileId($this->object->getPrimaryKey());
             $obj->setCollectionId($value);
             $obj->save();
         }
     }
 }