예제 #1
0
 /**
  * @see ProjectItemInterface::set_information()
  * @param string $description
  * @param string $keywords
  * @return bool
  */
 public function set_information($description, $keywords)
 {
     global $transaction;
     if ($description or $keywords) {
         $transaction_id = $transaction->begin();
         $item_information = new ItemInformation(null);
         if ($item_information->create($description, $keywords) != null) {
             if ($this->is_item_information() != false or $this->is_class_information(true) != false) {
                 if ($this->is_item_information() != false) {
                     $item_information->link_item($this->item_id);
                 }
                 if ($this->is_class_information(true) != false) {
                     $item_information->link_class($this->item_class_id);
                 }
                 if ($transaction_id != null) {
                     $transaction->commit($transaction_id);
                 }
                 return true;
             } else {
                 if ($transaction_id != null) {
                     $transaction->rollback($transaction_id);
                 }
                 return false;
             }
         } else {
             if ($transaction_id != null) {
                 $transaction->rollback($transaction_id);
             }
             return false;
         }
     } else {
         return false;
     }
 }