original_string: protected function validateAttributeProduct()
      {
          $fields = $this->getSubmitted('product_fields.attribute');
  
          if (empty($fields)) {
              return null;
          }
  
          $attributes = $this->getSubmitted('field.attribute');
  
          $errors = 0;
  
          foreach ($fields as $field_id => $field) {
              if (!empty($field['required']) && empty($attributes[$field_id])) {
                  $this->setErrorRequired("attribute.$field_id", $field['title']);
                  $errors++;
              }
          }
  
          return empty($errors);
      }
code: protected function validateAttributeProduct()
      {
          $fields = $this->getSubmitted('product_fields.attribute');
  
          if (empty($fields)) {
              return null;
          }
  
          $attributes = $this->getSubmitted('field.attribute');
  
          $errors = 0;
  
          foreach ($fields as $field_id => $field) {
              if (!empty($field['required']) && empty($attributes[$field_id])) {
                  $this->setErrorRequired("attribute.$field_id", $field['title']);
                  $errors++;
              }
          }
  
          return empty($errors);
      }
code_tokens: protected function validateAttributeProduct ( ) { $ fields = $ this -> getSubmitted ( 'product_fields.attribute' ) ; if ( empty ( $ fields ) ) { return null ; } $ attributes = $ this -> getSubmitted ( 'field.attribute' ) ; $ errors = 0 ; foreach ( $ fields as $ field_id => $ field ) { if ( ! empty ( $ field [ 'required' ] ) && empty ( $ attributes [ $ field_id ] ) ) { $ this -> setErrorRequired ( "attribute.$field_id" , $ field [ 'title' ] ) ; $ errors ++ ; } } return empty ( $ errors ) ; }
docstring: Validates an array of product attributes
  @return boolean|null
docstring_tokens: Validates an array of product attributes