Beans contain meta information; for instance the type of the bean. This information is hidden in a meta information field. You can use simple accessors to get and modify this meta information.
To get a meta property value:
$value = $bean->getMeta('my.property', $defaultIfNotExists);
The default default value is NULL.
To set a meta property:
The type (in 3.0+ this is always the same as the database table) of the bean is stored in meta property 'type' and can be retrieved as follows:
Since 3.0: Meta data can be used for explicit casts. For instance if you want to store something as a POINT datatype:
Here is an overview of all public meta properties used by the system. These meta properties are safe to read and can be used reliably to extract information about beans. Don't change them though!
|type||(string) Determines the type of the bean, don't change!|
|tainted||(boolean) Whether the bean has been modified.|
|cast.*||Used for explicit casting|
Here is an overview of all system meta properties. These meta properties should not be relied on, they are only for RedBeanPHP internal subsystems.
|buildcommand.indexes||issues extra options for query writer, for internal use only|
|buildreport.flags.*||Information about internal processes|
|sys.*||System information, never touch!|
|idfield||Deprecated. Don't touch!|
|buildcommand.unique||issues an extra option for query writer, use with care|
RedBeanPHP Easy ORM for PHP © 2013 Gabor de Mooij and the RedBeanPHP community - Licensed New BSD/GPLv2