original_string: protected function validateValueTypePriceRule()
      {
          $field = 'value_type';
  
          if ($this->isExcluded($field)) {
              return null;
          }
  
          $value = $this->getSubmitted($field);
  
          if ($this->isUpdating() && !isset($value)) {
              $this->unsetSubmitted($field);
              return null;
          }
  
          $types = $this->price_rule->getTypes();
  
          if (empty($types[$value])) {
              $this->setErrorInvalid($field, $this->translation->text('Value type'));
              return false;
          }
  
          return true;
      }
code: protected function validateValueTypePriceRule()
      {
          $field = 'value_type';
  
          if ($this->isExcluded($field)) {
              return null;
          }
  
          $value = $this->getSubmitted($field);
  
          if ($this->isUpdating() && !isset($value)) {
              $this->unsetSubmitted($field);
              return null;
          }
  
          $types = $this->price_rule->getTypes();
  
          if (empty($types[$value])) {
              $this->setErrorInvalid($field, $this->translation->text('Value type'));
              return false;
          }
  
          return true;
      }
code_tokens: protected function validateValueTypePriceRule ( ) { $ field = 'value_type' ; if ( $ this -> isExcluded ( $ field ) ) { return null ; } $ value = $ this -> getSubmitted ( $ field ) ; if ( $ this -> isUpdating ( ) && ! isset ( $ value ) ) { $ this -> unsetSubmitted ( $ field ) ; return null ; } $ types = $ this -> price_rule -> getTypes ( ) ; if ( empty ( $ types [ $ value ] ) ) { $ this -> setErrorInvalid ( $ field , $ this -> translation -> text ( 'Value type' ) ) ; return false ; } return true ; }
docstring: Validates a price rule value type
  @return boolean|null
docstring_tokens: Validates a price rule value type