protected function _validateTransitions(StatusModel $status)
 {
     if (count($status->getTransitions()) > 2) {
         $this->_messages[self::TOO_MANY_TRANSITIONS] = $this->_messageTemplatesUser[self::TOO_MANY_TRANSITIONS];
         return false;
     }
     if (count($status->getTransitions()) < 2) {
         $this->_messages[self::NOT_ENOUGH_TRANSITIONS] = $this->_messageTemplatesUser[self::NOT_ENOUGH_TRANSITIONS];
         return false;
     }
     if (!parent::_validateTransitions($status)) {
         return false;
     }
     if (!$this->_validateFirstUseTransition($status, LifeCycleModel::STATUS_ACTIVE)) {
         return false;
     }
     return true;
 }
Ejemplo n.º 2
0
 protected function _validateTransitions(StatusModel $status)
 {
     if (count($status->getTransitions()) > 2) {
         $this->_messages[self::TOO_MANY_TRANSITIONS] = $this->_messageTemplatesUser[self::TOO_MANY_TRANSITIONS];
         return false;
     }
     if (count($status->getTransitions()) < 2) {
         $this->_messages[self::NOT_ENOUGH_TRANSITIONS] = $this->_messageTemplatesUser[self::NOT_ENOUGH_TRANSITIONS];
         return false;
     }
     if (!parent::_validateTransitions($status)) {
         return false;
     }
     if ($this->getManual()) {
         if (!$this->_validateTransitionExists($status, LifeCycleModel::STATUS_ACTIVATION_PENDANT)) {
             return false;
         }
     } else {
         if (!$this->_validateTransitionExists($status, LifeCycleModel::STATUS_ACTIVATION_READY)) {
             return false;
         }
     }
     return true;
 }