You are here

function commerce_pricelist_item_load in Commerce Pricelist 7

Fetch a pricelist item.

This function ends up being a shim between the menu system and commerce_pricelist_item_load_multiple().

This function gets its name from the menu system's wildcard naming conventions. For example, /path/%wildcard would end up calling wildcard_load(%wildcard value). In our case defining the path: admin/commerce/pricelist/commerce_pricelist/basic/%commerce_pricelist_item in hook_menu() tells Drupal to call commerce_pricelist_item_load().

Parameters

int $entity_id: Integer specifying the basic entity id.

bool $reset: A boolean indicating that the internal cache should be reset.

Return value

object A fully-loaded $entity object or FALSE if it cannot be loaded.

See also

commerce_pricelist_item_load_multiple()

commerce_pricelist_menu()

1 call to commerce_pricelist_item_load()
FeedsCommercePricelistItemProcessor::entityLoad in commerce_pricelist_feeds/plugins/FeedsCommercePricelistItemProcessor.inc
Loads an existing pricelist_item.

File

./commerce_pricelist.module, line 776
Implements the basic functionality required for price lists

Code

function commerce_pricelist_item_load($entity_id = NULL, $reset = FALSE) {
  $entity_ids = isset($entity_id) ? array(
    $entity_id,
  ) : array();
  $entity = commerce_pricelist_item_load_multiple($entity_ids, array(), $reset);
  return $entity ? reset($entity) : FALSE;
}