SiwappProperty? class
This class let you save configuration properties of different types.
| ID | VALUE | TYPE | ATTRIBUTES | IS_DEFAULT |
| 1 | MH-NET-%year%- | invoicing_series | name=Internet Invoice | 1 |
| 2 | MH-DSGN-%year%- | invoicing_series | name=Design Invoice | 0 |
| 3 | MH-RECT-%year%- | rectification_series | name=Rectification Invoice | 1 |
| 4 | 16 | tax | name=IVA 16% | 1 |
| 5 | 7.3 | tax | name=IVA 7% | 0 |
| 6 | 4 | tax | name=IVA 4% | 0 |
Property value and wildcards
Wildcards are strings delimited by two % symbols. What wildcards can be used are defined programatically inside replaceWildcards static method of this class. They can be used as in example data (1, 2, 3). When user needs a property and you retrieve its value, by default it is parsed by replaceWildcards method, so %year% wildcard is replaced immediately with date('Y') result. If you want to retrieve RAW value use getRawValue method.
$property = SiwappPropertyPeer::retrieveByPK(1); echo $property->getValue(); // MH-NET-2008- echo $property->getRawValue(); // MH-NET-%year%-
Attributes
With overrided setAttributes method you can easily set URL style attributes into attributes field:
$myprop->setAttributes(array('prop1' => 'value1', 'prop2' => 'value2'));
$myprop->setAttributes('prop1=value1&prop2=value2');
Both are the same.
One commonly used attribute is name. name attribute is used to describe the property to the user on the interface.
For example, taxes can be named in configuration tab, and assigned a value. When you show them to the user you use the name attribute to refer that taxes.
Getting attribute information
You can retrieve attributes as an array with getAttributes method or you can get them passing as raw with getRawAttributes method:
$property->getRawAttributes(); // 'name=Internet Invoice'
$property->getAttributes(); // array('name' => 'Internet Invoice')
You can get one single attribute value with getAttribute method:
$property->getAttribute('name'); // 'Internet Invoice'

