protected function _validateCause(TransitionModel $trans)
 {
     if (!parent::_validateCause($trans)) {
         return false;
     }
     if (!$trans->getAutomaticInfo()->getFirstUseCause() || $trans->getAutomaticInfo()->getVoucherCause()) {
         if (!is_array($this->_messages)) {
             $this->_messages = array();
         }
         $this->_messages[self::NOT_FIRST_USE_CAUSE] = $this->_messageTemplatesUser[self::NOT_FIRST_USE_CAUSE];
         return false;
     }
     return true;
 }
 public function isValid($data, $context = null, $removeNotPresentFields = false)
 {
     if (!parent::isValid($data, $context, $removeNotPresentFields)) {
         return false;
     }
     if ($context instanceof StatusModel && $context->getStatus() !== LifeCycleModel::STATUS_TEST) {
         if (!is_array($this->_messages)) {
             $this->_messages = array();
         }
         $this->_messages[self::VOUCHER_CAUSE_ONLY_TEST] = $this->_messageTemplatesUser[self::VOUCHER_CAUSE_ONLY_TEST];
         return false;
     }
     return true;
 }