original_string: protected function validateDimensionProduct()
      {
          $fields = array(
              'width' => $this->translation->text('Width'),
              'height' => $this->translation->text('Height'),
              'length' => $this->translation->text('Length'),
              'weight' => $this->translation->text('Weight')
          );
  
          $errors = 0;
          foreach ($fields as $field => $label) {
  
              $value = $this->getSubmitted($field);
  
              if (!isset($value)) {
                  continue;
              }
  
              if (!is_numeric($value)) {
                  $errors++;
                  $this->setErrorNumeric($field, $label);
              }
  
              if (strlen($value) > 10) {
                  $errors++;
                  $this->setErrorLengthRange($field, $label, 0, 10);
              }
          }
  
          return empty($errors);
      }
code: protected function validateDimensionProduct()
      {
          $fields = array(
              'width' => $this->translation->text('Width'),
              'height' => $this->translation->text('Height'),
              'length' => $this->translation->text('Length'),
              'weight' => $this->translation->text('Weight')
          );
  
          $errors = 0;
          foreach ($fields as $field => $label) {
  
              $value = $this->getSubmitted($field);
  
              if (!isset($value)) {
                  continue;
              }
  
              if (!is_numeric($value)) {
                  $errors++;
                  $this->setErrorNumeric($field, $label);
              }
  
              if (strlen($value) > 10) {
                  $errors++;
                  $this->setErrorLengthRange($field, $label, 0, 10);
              }
          }
  
          return empty($errors);
      }
code_tokens: protected function validateDimensionProduct ( ) { $ fields = array ( 'width' => $ this -> translation -> text ( 'Width' ) , 'height' => $ this -> translation -> text ( 'Height' ) , 'length' => $ this -> translation -> text ( 'Length' ) , 'weight' => $ this -> translation -> text ( 'Weight' ) ) ; $ errors = 0 ; foreach ( $ fields as $ field => $ label ) { $ value = $ this -> getSubmitted ( $ field ) ; if ( ! isset ( $ value ) ) { continue ; } if ( ! is_numeric ( $ value ) ) { $ errors ++ ; $ this -> setErrorNumeric ( $ field , $ label ) ; } if ( strlen ( $ value ) > 10 ) { $ errors ++ ; $ this -> setErrorLengthRange ( $ field , $ label , 0 , 10 ) ; } } return empty ( $ errors ) ; }
docstring: Validates product dimensions
  @return boolean
docstring_tokens: Validates product dimensions