コード例 #1
0
 public function hasValidTarget()
 {
     if (!$this->_target_value) {
         return true;
     }
     switch ($this->_action_type) {
         case self::ACTION_ASSIGN_ISSUE:
             $target_details = explode('_', $this->_target_value);
             return (bool) ($target_details[0] == 'user') ? \thebuggenie\core\entities\User::doesIDExist($target_details[1]) : Team::doesIDExist($target_details[1]);
             break;
         case self::ACTION_SET_PERCENT:
             return (bool) ($this->_target_value > -1);
             break;
         case self::ACTION_SET_MILESTONE:
             return (bool) Milestone::doesIDExist($this->_target_value);
             break;
         case self::ACTION_SET_PRIORITY:
             return (bool) Priority::has($this->_target_value);
             break;
         case self::ACTION_SET_STATUS:
             return (bool) Status::has($this->_target_value);
             break;
         case self::ACTION_SET_REPRODUCABILITY:
             return (bool) Reproducability::has($this->_target_value);
             break;
         case self::ACTION_SET_RESOLUTION:
             return (bool) Resolution::has($this->_target_value);
             break;
         default:
             return true;
     }
 }