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') ? TBGUser::doesIDExist($target_details[1]) : TBGTeam::doesIDExist($target_details[1]); break; case self::ACTION_SET_PERCENT: return (bool) ($this->_target_value > -1); break; case self::ACTION_SET_MILESTONE: return (bool) TBGMilestone::doesIDExist($this->_target_value); break; case self::ACTION_SET_PRIORITY: return (bool) TBGPriority::has($this->_target_value); break; case self::ACTION_SET_STATUS: return (bool) TBGStatus::has($this->_target_value); break; case self::ACTION_SET_REPRODUCABILITY: return (bool) TBGReproducability::has($this->_target_value); break; case self::ACTION_SET_RESOLUTION: return (bool) TBGResolution::has($this->_target_value); break; default: return true; } }