original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Adds multiple attributes
  @param array $data
  @return boolean
docstring_tokens: Adds multiple attributes