Horde_Icalendar::getComponent PHP Метод

getComponent() публичный Метод

Retrieve a specific component.
public getComponent ( integer $idx ) : mixed
$idx integer The index of the object to retrieve.
Результат mixed (boolean) False if the index does not exist. (Horde_Icalendar_*) The requested component.
    public function getComponent($idx)
    {
        return isset($this->_components[$idx]) ? $this->_components[$idx] : false;
    }

Usage Example

Пример #1
0
 public function testGeo()
 {
     $ical = new Horde_Icalendar();
     $ical->parsevCalendar(file_get_contents(__DIR__ . '/fixtures/geo1.vcf'));
     $this->assertEquals(array('latitude' => -17.87, 'longitude' => 37.24), $ical->getComponent(0)->getAttribute('GEO'));
     $ical->parsevCalendar(file_get_contents(__DIR__ . '/fixtures/geo2.vcf'));
     $this->assertEquals(array('latitude' => 37.386013, 'longitude' => -122.082932), $ical->getComponent(0)->getAttribute('GEO'));
 }
All Usage Examples Of Horde_Icalendar::getComponent