Exemple #1
0
 /**
  * Adds a log entry
  *
  * @param integer $change_type Type of log entry
  * @param string $text The text to log
  * @param boolean $system Whether this is a user entry or a system entry
  */
 public function addLogEntry($change_type, $text = null, $previous_value = null, $current_value = null, $system = false, $time = null)
 {
     $uid = $system ? 0 : framework\Context::getUser()->getID();
     $log_item = new LogItem();
     $log_item->setChangeType($change_type);
     $log_item->setText($text);
     if ($time !== null) {
         $log_item->setTime($time);
     }
     if ($previous_value !== null) {
         $log_item->setPreviousValue($previous_value);
     }
     if ($current_value !== null) {
         $log_item->setCurrentValue($current_value);
     }
     $log_item->setTargetType(tables\Log::TYPE_ISSUE);
     $log_item->setTarget($this->getID());
     $log_item->setUser($uid);
     $log_item->save();
     $this->_log_items_added[$log_item->getID()] = $log_item;
     return $log_item;
 }
Exemple #2
0
 /**
  * Adds a log entry
  *
  * @param integer $change_type Type of log entry
  * @param string $text The text to log
  * @param boolean $system Whether this is a user entry or a system entry
  */
 public function addLogEntry($change_type, $text = null, $previous_value = null, $current_value = null, $system = false, $time = null)
 {
     $uid = $system ? 0 : framework\Context::getUser()->getID();
     $log_item = new LogItem();
     $log_item->setChangeType($change_type);
     $log_item->setText($text);
     if ($time !== null) {
         $log_item->setTime($time);
     }
     if ($previous_value !== null) {
         $log_item->setPreviousValue($previous_value);
     }
     if ($current_value !== null) {
         $log_item->setCurrentValue($current_value);
     }
     $log_item->setTargetType(tables\Log::TYPE_ISSUE);
     $log_item->setTarget($this->getID());
     $log_item->setUser($uid);
     $log_item->save();
     $this->_log_items_added[$log_item->getID()] = $log_item;
     framework\Event::createNew('core', 'thebuggenie\\core\\entities\\Issue::addLogEntry', $this)->trigger(['log_item' => $log_item]);
     return $log_item;
 }