You are here

function commerce_pricelist_feeds_get_importer in Commerce Pricelist 7

Get the first importer configured to be attached to price lists.

Return value

bool|int|string

2 calls to commerce_pricelist_feeds_get_importer()
commerce_pricelist_feeds_form_commerce_pricelist_list_form_alter in commerce_pricelist_feeds/commerce_pricelist_feeds.module
Implements hook_form_BASE_FORM_ID_alter().
commerce_pricelist_feeds_get_importer_id in commerce_pricelist_feeds/commerce_pricelist_feeds.module
Get the first importer configured to be attached to price lists.

File

commerce_pricelist_feeds/commerce_pricelist_feeds.module, line 189
Implements the basic functionality required to create and display an entity.

Code

function commerce_pricelist_feeds_get_importer() {
  $importers = feeds_importer_load_all();

  // Check if any one importer is configured as attached
  foreach ($importers as $id => $importer) {
    $conf = $importer->processor->config;
    if ($conf['bundle'] == 'commerce_pricelist_item' && $conf['is_attached']) {
      return $importer;
    }
  }
  return FALSE;
}