Properties: Difference between revisions

From Sunhill Framework Documentation
+ Outdated
Rewrite of article
Line 1: Line 1:
A '''property''' is a logical piece of information. The property class capsulates everything that has to do with type, validation, semantic meaning and access rights. The data itself is retrieved and stored to a [[Storages|storage]].
== Reading a property value ==
A typical read process would be:
# The property is called to return a value
# The property checks if the current user is allowed to read the information
# The property fetches the value from the connected storage
# Optional it formats the output to a human readable form
== Writing a property value ==
A typical write/modify process would be:
# The property is called to write/modify a value
# The property checks if the current user is allowed to write or modify the information
# The property checks if the given value is valid for the type and semantic meaning of the property
# The property passes the value to the storage
<!--
{{Outdated}}
{{Outdated}}
A property is a like a member variable of an Collection or ORMObject. They are accessed like normal members and normally you don't have to worry about there internal details. The only thing is, that you have to define them in the static setupProperties() method. This method takes a PropertyList parameter. A PropertyList is just a helper class that provides some defining methods to make it easy to define the properties (in fact it uses an similar concept like migrations of laravel). Via this PropertyList parameter you define the properties of your class. All property defining methods (like integer(), string(), etc.) take a name of the property as a parameter.
A property is a like a member variable of an Collection or ORMObject. They are accessed like normal members and normally you don't have to worry about there internal details. The only thing is, that you have to define them in the static setupProperties() method. This method takes a PropertyList parameter. A PropertyList is just a helper class that provides some defining methods to make it easy to define the properties (in fact it uses an similar concept like migrations of laravel). Via this PropertyList parameter you define the properties of your class. All property defining methods (like integer(), string(), etc.) take a name of the property as a parameter.
Line 185: Line 202:
  $list->externalReference('external_property');
  $list->externalReference('external_property');
  ...
  ...
-->

Revision as of 09:02, 11 September 2024

A property is a logical piece of information. The property class capsulates everything that has to do with type, validation, semantic meaning and access rights. The data itself is retrieved and stored to a storage.

Reading a property value

A typical read process would be:

  1. The property is called to return a value
  2. The property checks if the current user is allowed to read the information
  3. The property fetches the value from the connected storage
  4. Optional it formats the output to a human readable form

Writing a property value

A typical write/modify process would be:

  1. The property is called to write/modify a value
  2. The property checks if the current user is allowed to write or modify the information
  3. The property checks if the given value is valid for the type and semantic meaning of the property
  4. The property passes the value to the storage