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;
    }
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;
    }
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 ; }
Validates a product class
@return boolean|null
Validates a product class