You are here

class MerciItemProcessor in MERCI (Manage Equipment Reservations, Checkout and Inventory) 7.2

Creates nodes from feed items.

Hierarchy

Expanded class hierarchy of MerciItemProcessor

2 string references to 'MerciItemProcessor'
merci_import_example_feeds_importer_default in modules/merci_import/merci_import_example/merci_import_example.feeds_importer_default.inc
Implements hook_feeds_importer_default().
merci_import_feeds_plugins in modules/merci_import/merci_import.module
Implementation of hook_feeds_plugins().

File

modules/merci_import/MerciItemProcessor.inc, line 11
Class definition of FeedsNodeProcessor.

View source
class MerciItemProcessor extends FeedsNodeProcessor {

  /**
   * Override parent::configForm().
   */
  public function configForm(&$form_state) {
    $form = parent::configForm($form_state);
    $form['content_type']['#description'] .= t('  Content type can be overridden by mapping.');
    return $form;
  }

  /**
   * Creates a new node in memory and returns it.
   */
  protected function newEntity(FeedsSource $source) {
    $node = parent::newEntity($source);
    $node->merci_sub_type = MERCI_SUB_TYPE_ITEM;
    return $node;
  }

  /**
   * Return available mapping targets.
   */
  public function getMappingTargets() {
    $targets = parent::getMappingTargets();
    $targets += array(
      'type' => array(
        'name' => t('Content type'),
        'description' => t('The content type of the node.'),
      ),
      'merci_default_availability' => array(
        'name' => t('MERCI default availability'),
        'description' => 'Default availability of the item .',
      ),
      'merci_late_fee_per_hour' => array(
        'name' => t('MERCI late fee per hour'),
        'description' => "Per hour fee if the resource is returned late.",
      ),
      'merci_rate_per_hour' => array(
        'name' => t('MERCI rate per hour'),
        'description' => "Per hour fee for use of the resource.",
      ),
      'merci_fee_free_hours' => array(
        'name' => t('MERCI fee free hours'),
        'description' => "Number of hours the item can be used before fees are charged.",
      ),
      'merci_min_cancel_hours' => array(
        'name' => t('MERCI min cancel hours'),
        'description' => "Minimum number of hours a user can cancel a reservation for the item.",
      ),
      'merci_autocheckout' => array(
        'name' => t('MERCI autocheckout'),
        'description' => "TRUE if the resource is automatically checked out when Reservation starts.",
      ),
      'merci_autocheckin' => array(
        'name' => t('MERCI autocheckin'),
        'description' => "TRUE if the resource is automatically checked in when Reservation starts.",
      ),
      'merci_selfcheckout' => array(
        'name' => t('MERCI selfcheckout'),
        'description' => "TRUE if the resource is managed by selfcheckout.",
      ),
    );
    return $targets;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
MerciItemProcessor::configForm public function Override parent::configForm().
MerciItemProcessor::getMappingTargets public function Return available mapping targets.
MerciItemProcessor::newEntity protected function Creates a new node in memory and returns it.