private function getType(iRemoteCalendar $iCalendar) { $components = $iCalendar->component->GetComponents(); // Find VCalender component foreach ($components as $type) { try { $vtype = new VTYPE($type->GetType()); if ($vtype->ordinal() != VTYPE::VTIMEZONE) { break; } } catch (Exception $ex) { } } return $vtype; }
public function getComponent($type) { $ref = $this->component; //print_r($ref); if ($this->component === NULL) { $ical = NULL; } else { if ($type instanceof VTYPE && $type->ordinal() == VTYPE::VTIMEZONE) { $ical = $ref->component->GetComponents('VTIMEZONE'); } else { //$theType = sprintf("%s", $this->type); //print "self: $theType\n"; $component = $ref->component->GetComponents($this->type); //print_r($component); if (!$type instanceof VTYPE) { $type = new VTYPE($type); } //$theType = sprintf("%s", $type); //print "instance: $theType\n"; if (count($component) > 0) { $ical = $component[0]; } if ($type->ordinal() != $this->type->ordinal() && $ical) { $ical = $ical->GetComponents($type); } } } return $ical; }