}
}
if (!count($result)) {
- return PEAR::raiseError('Attribute "' . $name . '" Not Found');
+ return new PEAR_Error('Attribute "' . $name . '" Not Found');
} if (count($result) == 1 && !$params) {
return $result[0];
} else {
*/
function addComponent($component)
{
- if (is_a($component, 'Horde_iCalendar')) {
+ if ($component instanceOf Horde_iCalendar) {
$component->_container = &$this;
$this->_components[] = &$component;
}
$childclass = 'Horde_iCalendar_' . Horde_String::lower($childclass);
$keys = array_keys($this->_components);
foreach ($keys as $key) {
- if (is_a($this->_components[$key], $childclass)) {
+ if ($this->_components[$key] instanceOf $childclass) {
$attr = $this->_components[$key]->getAttribute($attribute);
- if (is_a($attr, 'PEAR_Error')) {
+ if ($attr instanceOf PEAR_Error) {
continue;
}
if ($value !== null && $value != $attr) {
// Get timezone info for date fields from $tzid and container.
$tzoffset = ($time['zone'] == 'Local' && $tzid &&
- is_a($this->_container, 'Horde_iCalendar'))
+ $this->_container instanceOf Horde_iCalendar)
? $this->_parseTZID($date, $time, $tzid) : false;
if ($time['zone'] == 'UTC' || $tzoffset !== false) {
$result = @gmmktime($time['hour'], $time['minute'], $time['second'],
$result['time'] = 0;
$t = $child->getAttribute('TZOFFSETFROM');
- if (is_a($t, 'PEAR_Error')) {
+ if ($t instanceOf PEAR_Error) {
return false;
}
$result['from'] = ($t['hour'] * 60 * 60 + $t['minute'] * 60) * ($t['ahead'] ? 1 : -1);
$t = $child->getAttribute('TZOFFSETTO');
- if (is_a($t, 'PEAR_Error')) {
+ if ($t instanceOf PEAR_Error) {
return false;
}
$result['to'] = ($t['hour'] * 60 * 60 + $t['minute'] * 60) * ($t['ahead'] ? 1 : -1);
$switch_time = $child->getAttribute('DTSTART');
- if (is_a($switch_time, 'PEAR_Error')) {
+ if ($switch_time instanceOf PEAR_Error) {
return false;
}
$rrules = $child->getAttribute('RRULE');
- if (is_a($rrules, 'PEAR_Error')) {
+ if ($rrules instanceOf PEAR_Error) {
if (!is_int($switch_time)) {
return false;
}