original_string: protected function validateMajorUnitCurrency()
      {
          $field = 'major_unit';
  
          if ($this->isExcluded($field)) {
              return null;
          }
  
          $value = $this->getSubmitted($field);
  
          if ($this->isUpdating() && !isset($value)) {
              $this->unsetSubmitted($field);
              return null;
          }
  
          if (empty($value) || mb_strlen($value) > 50) {
              $this->setErrorLengthRange($field, $this->translation->text('Major unit'), 1, 50);
              return false;
          }
  
          return true;
      }
code: protected function validateMajorUnitCurrency()
      {
          $field = 'major_unit';
  
          if ($this->isExcluded($field)) {
              return null;
          }
  
          $value = $this->getSubmitted($field);
  
          if ($this->isUpdating() && !isset($value)) {
              $this->unsetSubmitted($field);
              return null;
          }
  
          if (empty($value) || mb_strlen($value) > 50) {
              $this->setErrorLengthRange($field, $this->translation->text('Major unit'), 1, 50);
              return false;
          }
  
          return true;
      }
code_tokens: protected function validateMajorUnitCurrency ( ) { $ field = 'major_unit' ; if ( $ this -> isExcluded ( $ field ) ) { return null ; } $ value = $ this -> getSubmitted ( $ field ) ; if ( $ this -> isUpdating ( ) && ! isset ( $ value ) ) { $ this -> unsetSubmitted ( $ field ) ; return null ; } if ( empty ( $ value ) || mb_strlen ( $ value ) > 50 ) { $ this -> setErrorLengthRange ( $ field , $ this -> translation -> text ( 'Major unit' ) , 1 , 50 ) ; return false ; } return true ; }
docstring: Validates currency major unit
  @return boolean|null
docstring_tokens: Validates currency major unit