original_string: protected function addOptions(array $data)
      {
          if (empty($data['combination'])) {
              return false;
          }
  
          foreach ($data['combination'] as $combination) {
  
              if (empty($combination['fields'])) {
                  continue;
              }
  
              foreach ($combination['fields'] as $field_id => $field_value_id) {
  
                  $options = array(
                      'type' => 'option',
                      '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 addOptions(array $data)
      {
          if (empty($data['combination'])) {
              return false;
          }
  
          foreach ($data['combination'] as $combination) {
  
              if (empty($combination['fields'])) {
                  continue;
              }
  
              foreach ($combination['fields'] as $field_id => $field_value_id) {
  
                  $options = array(
                      'type' => 'option',
                      '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 addOptions ( array $ data ) { if ( empty ( $ data [ 'combination' ] ) ) { return false ; } foreach ( $ data [ 'combination' ] as $ combination ) { if ( empty ( $ combination [ 'fields' ] ) ) { continue ; } foreach ( $ combination [ 'fields' ] as $ field_id => $ field_value_id ) { $ options = array ( 'type' => 'option' , '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 options
  @param array $data
  @return boolean
docstring_tokens: Adds multiple options