99 $args = func_get_args();
100 if (
count($args) === 0 || is_array($args[0])) {
101 array_unshift($args, $this, static::$defaultName);
102 call_user_func_array([
'parent',
'__construct'], $args);
104 array_unshift($args, $this);
105 call_user_func_array([
'parent',
'__construct'], $args);
117 return self::UNKNOWN;
134 if (isset(static::$componentMap[strtoupper(
$name)])) {
136 return call_user_func_array([$this,
'createComponent'], func_get_args());
140 return call_user_func_array([$this,
'createProperty'], func_get_args());
169 $class =
'Sabre\\VObject\\Component';
171 if (isset(static::$componentMap[
$name])) {
172 $class = static::$componentMap[
$name];
175 return new $class($this, $name,
$children, $defaults);
199 if ((
$i = strpos(
$name,
'.')) !==
false) {
215 if (is_null($class)) {
217 if (isset($parameters[
'VALUE'])) {
219 if (is_null($class)) {
220 throw new InvalidDataException(
'Unsupported VALUE parameter for ' .
$name .
' property. You supplied "' . $parameters[
'VALUE'] .
'"');
227 if (is_null($parameters)) $parameters = [];
229 return new $class($this,
$name, $value, $parameters, $group);
246 $valueParam = strtoupper($valueParam);
247 if (isset(static::$valueMap[$valueParam])) {
248 return static::$valueMap[$valueParam];
262 if (isset(static::$propertyMap[$propertyName])) {
263 return static::$propertyMap[$propertyName];
265 return 'Sabre\\VObject\\Property\\Unknown';
create($name)
Creates a new component or property.
__construct()
Creates a new document.
createProperty($name, $value=null, array $parameters=null, $valueType=null)
Factory method for creating new properties.
getClassNameForPropertyName($propertyName)
Returns the default class for a property name.
getClassNameForPropertyValue($valueParam)
This method returns a full class-name for a value parameter.
const UNKNOWN
Unknown document type.
const ICALENDAR20
iCalendar 2.0.
createComponent($name, array $children=null, $defaults=true)
Creates a new component.
count()
Returns the number of elements.
getDocumentType()
Returns the current document type.
const VCALENDAR10
vCalendar 1.0.
This exception is thrown whenever an invalid value is found anywhere in a iCalendar or vCard object...