本文整理匯總了PHP中Horde_Icalendar::setVersion方法的典型用法代碼示例。如果您正苦於以下問題:PHP Horde_Icalendar::setVersion方法的具體用法?PHP Horde_Icalendar::setVersion怎麽用?PHP Horde_Icalendar::setVersion使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Horde_Icalendar
的用法示例。
在下文中一共展示了Horde_Icalendar::setVersion方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: setAttribute
/**
* Sets the value of an attribute.
*
* @param string $name The name of the attribute.
* @param string $value The value of the attribute.
* @param array $params Array containing any addition parameters for
* this attribute.
* @param boolean $append True to append the attribute, False to replace
* the first matching attribute found.
* @param array $values Array representation of $value. For
* comma/semicolon seperated lists of values. If
* not set use $value as single array element.
*/
public function setAttribute($name, $value, $params = array(), $append = true, $values = false)
{
// Make sure we update the internal format version if
// setAttribute('VERSION', ...) is called.
if ($name == 'VERSION') {
$this->setVersion($value);
if ($this->_container !== false) {
$this->_container->setVersion($value);
}
}
if (!$values) {
$values = array($value);
}
$found = false;
if (!$append) {
foreach (array_keys($this->_attributes) as $key) {
if ($this->_attributes[$key]['name'] == Horde_String::upper($name)) {
$this->_attributes[$key]['params'] = $params;
$this->_attributes[$key]['value'] = $value;
$this->_attributes[$key]['values'] = $values;
$found = true;
break;
}
}
}
if ($append || !$found) {
$this->_attributes[] = array('name' => Horde_String::upper($name), 'params' => $params, 'value' => $value, 'values' => $values);
}
}