Get attributes for all tags or for a given tag.
public getAllAttributes ( string $tag = false ) : array | ||
$tag | string | Return attributes for this tag, or all attributes if not given. |
Résultat | array | An array containing all the attributes and their types. |
public function testVcalendar20() { $ical = new Horde_Icalendar(); $ical->parsevCalendar(file_get_contents(__DIR__ . '/fixtures/vcal20.ics')); $this->assertEquals(array(0 => array('name' => 'PRODID', 'params' => array(), 'value' => '-//Google Inc//Google Calendar 70.9054//EN', 'values' => array(0 => '-//Google Inc//Google Calendar 70.9054//EN')), 1 => array('name' => 'VERSION', 'params' => array(), 'value' => '2.0', 'values' => array(0 => '2.0')), 2 => array('name' => 'CALSCALE', 'params' => array(), 'value' => 'GREGORIAN', 'values' => array(0 => 'GREGORIAN')), 3 => array('name' => 'METHOD', 'params' => array(), 'value' => 'PUBLISH', 'values' => array(0 => 'PUBLISH')), 4 => array('name' => 'X-WR-CALNAME', 'params' => array(), 'value' => 'PEAR - PHP Extension and Application Repository', 'values' => array(0 => 'PEAR - PHP Extension and Application Repository')), 5 => array('name' => 'X-WR-TIMEZONE', 'params' => array(), 'value' => 'Atlantic/Reykjavik', 'values' => array(0 => 'Atlantic/Reykjavik')), 6 => array('name' => 'X-WR-CALDESC', 'params' => array(), 'value' => 'pear.php.net activity calendar, bug triage, group meetings, qa, conferences or similar', 'values' => array(0 => 'pear.php.net activity calendar, bug triage, group meetings, qa, conferences or similar'))), $ical->getAllAttributes()); $this->assertEquals(array(0 => array('name' => 'DTSTART', 'params' => array(), 'value' => 1224950400, 'values' => array(0 => 1224950400)), 1 => array('name' => 'DTEND', 'params' => array(), 'value' => 1224968400, 'values' => array(0 => 1224968400)), 2 => array('name' => 'DTSTAMP', 'params' => array(), 'value' => 1219138073, 'values' => array(0 => 1219138073)), 3 => array('name' => 'UID', 'params' => array(), 'value' => '*****@*****.**', 'values' => array(0 => '*****@*****.**')), 4 => array('name' => 'RECURRENCE-ID', 'params' => array(), 'value' => 1224950400, 'values' => array(0 => 1224950400)), 5 => array('name' => 'CLASS', 'params' => array(), 'value' => 'PUBLIC', 'values' => array(0 => 'PUBLIC')), 6 => array('name' => 'CREATED', 'params' => array(), 'value' => 1204763165, 'values' => array(0 => 1204763165)), 7 => array('name' => 'DESCRIPTION', 'params' => array(), 'value' => 'Bug Triage session Not been invited ? Want to attend ? Let us know and we\'ll add you!', 'values' => array(0 => 'Bug Triage session Not been invited ? Want to attend ? Let us know and we\'ll add you!')), 8 => array('name' => 'LAST-MODIFIED', 'params' => array(), 'value' => 1216413606, 'values' => array(0 => 1216413606)), 9 => array('name' => 'LOCATION', 'params' => array(), 'value' => '#pear-bugs Efnet', 'values' => array(0 => '#pear-bugs Efnet')), 10 => array('name' => 'SEQUENCE', 'params' => array(), 'value' => 2, 'values' => array(0 => 2)), 11 => array('name' => 'STATUS', 'params' => array(), 'value' => 'CONFIRMED', 'values' => array(0 => 'CONFIRMED')), 12 => array('name' => 'SUMMARY', 'params' => array(), 'value' => 'Bug Triage', 'values' => array(0 => 'Bug Triage')), 13 => array('name' => 'TRANSP', 'params' => array(), 'value' => 'OPAQUE', 'values' => array(0 => 'OPAQUE')), 14 => array('name' => 'CATEGORIES', 'params' => array(), 'value' => 'foo,bar,fuz buz,blah, blah', 'values' => array(0 => 'foo', 1 => 'bar', 2 => 'fuz buz', 3 => 'blah, blah'))), $ical->getComponent(0)->getAllAttributes()); }