You are here

public function AvailabilityCalendarICalFeedsProcessor::getMappingTargets in Availability Calendars 7.5

Declare possible mapping targets that this processor exposes.

Return value

array An array of mapping targets. Keys are paths to targets separated by ->, values are TRUE if target can be unique, FALSE otherwise.

Throws

\EntityMalformedException

1 call to AvailabilityCalendarICalFeedsProcessor::getMappingTargets()
AvailabilityCalendarICalFeedsProcessor::map in ./AvailabilityCalendarICalFeedsProcessor.inc
Execute mapping on an item.

File

./AvailabilityCalendarICalFeedsProcessor.inc, line 110

Class

AvailabilityCalendarICalFeedsProcessor
@class ICalendar processor for availability calendars.

Code

public function getMappingTargets() {
  $targets = array();
  foreach (field_info_instances($this
    ->entityType(), $this
    ->bundle()) as $name => $instance) {
    $info = field_info_field($name);
    if ($info['type'] === 'availability_calendar') {
      $targets[$name] = array(
        'name' => $instance['label'],
        'description' => t('The target availability calendar to add the events to.'),
      );
    }
  }
  return $targets;
}