protected function addAttributes(array $data)
    {
        if (empty($data['field']['attribute'])) {
            return false;
        }

        foreach ($data['field']['attribute'] as $field_id => $field_value_ids) {
            foreach ((array) $field_value_ids as $field_value_id) {

                $options = array(
                    'type' => 'attribute',
                    'field_id' => $field_id,
                    'product_id' => $data['product_id'],
                    'field_value_id' => $field_value_id
                );

                $this->product_field->add($options);
            }
        }

        return true;
    }
protected function addAttributes(array $data)
    {
        if (empty($data['field']['attribute'])) {
            return false;
        }

        foreach ($data['field']['attribute'] as $field_id => $field_value_ids) {
            foreach ((array) $field_value_ids as $field_value_id) {

                $options = array(
                    'type' => 'attribute',
                    'field_id' => $field_id,
                    'product_id' => $data['product_id'],
                    'field_value_id' => $field_value_id
                );

                $this->product_field->add($options);
            }
        }

        return true;
    }
protected function addAttributes ( array $ data ) { if ( empty ( $ data [ 'field' ] [ 'attribute' ] ) ) { return false ; } foreach ( $ data [ 'field' ] [ 'attribute' ] as $ field_id => $ field_value_ids ) { foreach ( ( array ) $ field_value_ids as $ field_value_id ) { $ options = array ( 'type' => 'attribute' , 'field_id' => $ field_id , 'product_id' => $ data [ 'product_id' ] , 'field_value_id' => $ field_value_id ) ; $ this -> product_field -> add ( $ options ) ; } } return true ; }
Adds multiple attributes
@param array $data
@return boolean
Adds multiple attributes