original_string: protected function validateClassProduct()
      {
          $field = 'product_class_id';
          $value = $this->getSubmitted($field);
  
          if (empty($value)) {
              return null;
          }
  
          $label = $this->translation->text('Product class');
  
          if (!is_numeric($value)) {
              $this->setErrorNumeric($field, $label);
              return false;
          }
  
          $product_class = $this->product_class->get($value);
  
          if (empty($product_class)) {
              $this->setErrorUnavailable($field, $label);
              return false;
          }
  
          $fields = $this->product_class->getFields($value);
          $this->setSubmitted('product_fields', $fields);
          return true;
      }
code: protected function validateClassProduct()
      {
          $field = 'product_class_id';
          $value = $this->getSubmitted($field);
  
          if (empty($value)) {
              return null;
          }
  
          $label = $this->translation->text('Product class');
  
          if (!is_numeric($value)) {
              $this->setErrorNumeric($field, $label);
              return false;
          }
  
          $product_class = $this->product_class->get($value);
  
          if (empty($product_class)) {
              $this->setErrorUnavailable($field, $label);
              return false;
          }
  
          $fields = $this->product_class->getFields($value);
          $this->setSubmitted('product_fields', $fields);
          return true;
      }
code_tokens: protected function validateClassProduct ( ) { $ field = 'product_class_id' ; $ value = $ this -> getSubmitted ( $ field ) ; if ( empty ( $ value ) ) { return null ; } $ label = $ this -> translation -> text ( 'Product class' ) ; if ( ! is_numeric ( $ value ) ) { $ this -> setErrorNumeric ( $ field , $ label ) ; return false ; } $ product_class = $ this -> product_class -> get ( $ value ) ; if ( empty ( $ product_class ) ) { $ this -> setErrorUnavailable ( $ field , $ label ) ; return false ; } $ fields = $ this -> product_class -> getFields ( $ value ) ; $ this -> setSubmitted ( 'product_fields' , $ fields ) ; return true ; }
docstring: Validates a product class
  @return boolean|null
docstring_tokens: Validates a product class