You are here

public function ParserVcalendar::parseMultivalueProperty in Date iCal 7.3

Handler that parses multi-value fields, like the CATEGORIES component.

Return value

array An array of strings contaning the individual values.

File

libraries/ParserVcalendar.inc, line 426
Defines a class that parses iCalcreator vcalendar objects into Feeds-compatible data arrays.

Class

ParserVcalendar
@file Defines a class that parses iCalcreator vcalendar objects into Feeds-compatible data arrays.

Code

public function parseMultivalueProperty($property_key, $vcalendar_component) {

  // Since we're not telling it to give us the params data, $property will
  // be either FALSE, a string, or an array of strings.
  $property = $vcalendar_component
    ->getProperty($property_key);
  if (empty($property)) {

    // If this multi-value property is being mapped to a Taxonomy field,
    // Feeds will interpret anything besides empty array as an array of
    // empty values (e.g. array('')). This will create a term for that
    // empty value, rather than leaving the field blank.
    return array();
  }
  if (!is_array($property)) {
    $property = array(
      $property,
    );
  }
  return $property;
}