Type / name / value
Properties not only are name/value pairs, they even have a type which allows for grouping of properties which belong together. You can, or maybe should, give all properties used for the same module or plugin the same type. Their name will then tell which meaning the property value has.
Scope / object
Properties also have a scope for which they are defined. Properties can be defined for the whole system, a single client, a language (what makes them somehow translatable client settings), a group of users or even a single user.
Properties are (unfortunately) stored in a multitude of database tables:
|Client, ClientLanguage & Other||properties|
There exist a couple of ways to read properties from database. Each object for which properties can be defined offers its own API to CRUD them.
Explain the multitude of ways to CRUD properties using their cApi classes and functions (getSystemProperty).
Beyond all these approaches their is a central function called
getEffectiveSetting() which is special in two ways. First, it not only looks for properties of a single object and second, it allows for the definition of a default value.
An effective setting is a property, which goes through a list of possible places to look after.
If an effective setting is requested, CONTENIDO is looking for it in the following order, returning the value of the property which applies last:
- System property
- Client property
- Client language based property
- Group property (if logged in)
- User property (if logged in)
For example, it is possible, that a logged in user gets an other value of a requested property as a not logged in user (because the guest would get at least a client language based property value).