protected function attachFields(array &$product)
    {
        if (empty($product)) {
            return $product;
        }

        $product['field'] = $this->product_field->getList($product['product_id']);

        if (empty($product['field']['option'])) {
            return $product;
        }

        foreach ($product['field']['option'] as &$field_values) {
            $field_values = array_unique($field_values);
        }

        return $product;
    }
protected function attachFields(array &$product)
    {
        if (empty($product)) {
            return $product;
        }

        $product['field'] = $this->product_field->getList($product['product_id']);

        if (empty($product['field']['option'])) {
            return $product;
        }

        foreach ($product['field']['option'] as &$field_values) {
            $field_values = array_unique($field_values);
        }

        return $product;
    }
protected function attachFields ( array & $ product ) { if ( empty ( $ product ) ) { return $ product ; } $ product [ 'field' ] = $ this -> product_field -> getList ( $ product [ 'product_id' ] ) ; if ( empty ( $ product [ 'field' ] [ 'option' ] ) ) { return $ product ; } foreach ( $ product [ 'field' ] [ 'option' ] as & $ field_values ) { $ field_values = array_unique ( $ field_values ) ; } return $ product ; }
Adds fields to the product
@param array $product
@return array
Adds fields to the product