toHash() public method

Function to convert a Horde_Icalendar_Vcard object into a Turba Object Hash with Turba attributes suitable as a parameter for add().
See also: add()
public toHash ( Horde_Icalendar_Vcard $vcard ) : array
$vcard Horde_Icalendar_Vcard The Horde_Icalendar_Vcard object to parse.
return array A Turba attribute hash.
Ejemplo n.º 1
0
 protected function toHash($vcard, $map = array())
 {
     $driver = new Turba_Driver();
     foreach ($map as $field => $config) {
         $driver->map[$field] = $config;
     }
     $ical = new Horde_Icalendar();
     $ical->parsevCalendar($vcard);
     return $driver->toHash($ical->getComponent(0));
 }