Methods |
public
|
__construct()
Creates a new document.
Creates a new document.
We're changing the default behavior slightly here. First, we don't want
to have to specify a name (we already know it), and we want to allow
children to be specified in the first argument.
But, the default behavior also works.
So the two sigs:
new Document(array $children = [], $defaults = true);
new Document(string $name, array $children = [], $defaults = true)
Overrides
|
#
|
public
|
getDocumentType(): int
Returns the current document type.
Returns the current document type.
Overriden by
|
#
|
public
|
create(string $name): mixed
Creates a new component or property.
Creates a new component or property.
If it's a known component, we will automatically call createComponent.
otherwise, we'll assume it's a property and call createProperty instead.
|
#
|
public
|
createComponent(string $name, array $children = null, bool $defaults = true): Component
Creates a new component.
Creates a new component.
This method automatically searches for the correct component class, based
on its name.
You can specify the children either in key=>value syntax, in which case
properties will automatically be created, or you can just pass a list of
Component and Property object.
By default, a set of sensible values will be added to the component. For
an iCalendar object, this may be something like CALSCALE:GREGORIAN. To
ensure that this does not happen, set $defaults to false.
|
#
|
public
|
createProperty(string $name, mixed $value = null, array $parameters = null, string $valueType = null): Property
Factory method for creating new properties.
Factory method for creating new properties.
This method automatically searches for the correct property class, based
on its name.
You can specify the parameters either in key=>value syntax, in which case
parameters will automatically be created, or you can just pass a list of
Parameter objects.
Parameters
$valueType |
Force a specific valuetype, such as URI or TEXT
|
|
#
|
public
|
getClassNameForPropertyValue(string $valueParam): string|null
This method returns a full class-name for a value parameter.
This method returns a full class-name for a value parameter.
For instance, DTSTART may have VALUE=DATE. In that case we will look in
our valueMap table and return the appropriate class name.
This method returns null if we don't have a specialized class.
|
#
|
public
|
getClassNameForPropertyName(string $propertyName): string
Returns the default class for a property name.
Returns the default class for a property name.
|
#
|