Public Member Functions | |
| __construct (dbo_def $dbo_def, $name, $type, $options) | |
| Constructor. | |
| sql_quote_value ($value) | |
| Escape atribute value for use in SQL. | |
Public Attributes | |
| $dbo_def | |
| [dbo_def] Definition of DBO that owns this attribute. | |
| $name | |
| [string] Name of the attribute. | |
| $type | |
| [string] Attribute type (XXX: list). | |
| $optional | |
| [boolean] Attribute may be null. | |
| $default | |
| [any] Default value of an attribute. | |
| $max_length | |
| [int] Maximum length of the attribute (if type == string). | |
| $min_length | |
| [int] Minimum length of the attribute (if type == string). | |
| $multilang | |
| [boolean] Attribute is stored in multiple languages. | |
| $readonly | |
| [boolean] Readonly attribute, can't be chnaged, does not have setter. | |
| $volatile | |
| [boolean] Volatile attribute, must be read from DB on each attr_get(). | |
| $title | |
| [string] Title for the attribute in the forms, sortabs, etc. | |
| $help | |
| [string] Help text. | |
| $tip | |
| [string] Tip text. | |
| $control | |
| [string] Default form control type for this attribute. | |
Private Member Functions | |
| sql_date ($v) | |
| Convert date into YYYY-MM-DD HH:MM:SS format (for use in SQL statements). | |
This class contains information about specific entity attribute. You may access entity attributes using dbo_registry::get('name')->attrs.
| dbo_attr_def::__construct | ( | dbo_def $ | dbo_def, | |
| $ | name, | |||
| $ | type, | |||
| $ | options | |||
| ) |
| dbo_attr_def::sql_date | ( | $ | v | ) | [private] |
Convert date into YYYY-MM-DD HH:MM:SS format (for use in SQL statements).
| v | [string|int] Date/time string or UNIX time. |
Referenced by sql_quote_value().
| dbo_attr_def::sql_quote_value | ( | $ | value | ) |
Escape atribute value for use in SQL.
This function may use different escape styles based on the type of the attribute.
| value | [string] Attribute value. |
References sql_date().
| dbo_attr_def::$control |
[string] Default form control type for this attribute.
| dbo_attr_def::$default |
[any] Default value of an attribute.
| dbo_attr_def::$help |
[string] Help text.
| dbo_attr_def::$max_length |
[int] Maximum length of the attribute (if type == string).
| dbo_attr_def::$min_length |
[int] Minimum length of the attribute (if type == string).
| dbo_attr_def::$multilang |
[boolean] Attribute is stored in multiple languages.
| dbo_attr_def::$name |
| dbo_attr_def::$optional |
[boolean] Attribute may be null.
| dbo_attr_def::$readonly |
[boolean] Readonly attribute, can't be chnaged, does not have setter.
| dbo_attr_def::$tip |
[string] Tip text.
| dbo_attr_def::$title |
[string] Title for the attribute in the forms, sortabs, etc.
| dbo_attr_def::$type |
| dbo_attr_def::$volatile |
[boolean] Volatile attribute, must be read from DB on each attr_get().