The domain entities in these packages are equipped with the commonly needed properties. In some cases these properties do not fully cover every use case. In the following, a way how to add custom properties to the event entity and in result to the generated iCal file is described.
In this tutorial, we will add a custom property called
X-CUSTOM to the iCal file, which can look like this:
First we need to create a custom event entity to store the additional value.
This can be done by extending from
The following example shows a class with an added property named
It is up to you, how to implement this class.
In this example, the property is read-only.
The presentation components are created by factories.
It is possible to extend these factories to add custom properties to the iCal file.
In the following example, the factory reads the value
$myCustomProperty and adds its value as property
A new custom event can now be created.
To see the new property, an instance of class
CustomEventFactory must be passed to the standard calendar factory:
After that, the iCal file can be rendered like normal.
For a full sample, please have a look at