You are here

function commerce_option_load_by_line_item in Commerce Product Option 7.2

Same name and namespace in other branches
  1. 7 commerce_option.module \commerce_option_load_by_line_item()

Load all options associated with a line item.

Parameters

$line_item_id: Line item id.

Return value

Array of options

1 call to commerce_option_load_by_line_item()
commerce_option_entity_delete in ./commerce_option.module
Implements hook_entity_delete().

File

./commerce_option.module, line 291

Code

function commerce_option_load_by_line_item($line_item_id) {
  $option_ids = db_select('commerce_option', 'o')
    ->fields('o', array(
    'option_id',
  ))
    ->condition('line_item_id', $line_item_id, '=')
    ->execute()
    ->fetchCol();
  return commerce_option_load_multiple($option_ids);
}