Public Member Functions | |
| get_object ($type, $id) | |
| Get existing object from the session. | |
| put_object (dbo $obj) | |
| Put existing or new object into session. | |
| get_named_object ($name) | |
| Get object that is associated with given name. | |
| set_object_name ($obj, $name) | |
| Associate name with some object. | |
| check () | |
| Check validity of DBO session objects. | |
| dump ($invalid_only=false, $level=1) | |
| Dump DBO objects to string. | |
| commit () | |
| Commit session to the database. | |
Public Attributes | |
| $context | |
| $message | |
| [string|null] Commit error message. | |
Private Attributes | |
| $objects = array() | |
| $new_objects = array() | |
| $named_objects = array() | |
DBO session is used to keep track of DBO objects that are retrieved from database or created by the user. It is also used to commit changes to the database.
Use dbo_manager to store/load DBO session to/from PHP session.
Also to be able to get some particular object from DBO session that is loaded from PHP session, you have to name object before storing session.
Session may also have context associated with it, which can be used to modify behaviour of DBOs stored in the session.
| dbo_session::check | ( | ) |
Check validity of DBO session objects.
You may use this multiple times for same session. After check you may want to browse through all obejcts to collect error messages.
Referenced by commit().
| dbo_session::commit | ( | ) |
Commit session to the database.
You may use this multiple times for same session.
References $objects, check(), and put_object().
| dbo_session::dump | ( | $ | invalid_only = false, |
|
| $ | level = 1 | |||
| ) |
Dump DBO objects to string.
| invalid_only | [boolean] Dump only invalid DBOs. | |
| level | [int] Dump depth. |
| dbo_session::get_named_object | ( | $ | name | ) |
Get object that is associated with given name.
| name | [string] Name. |
| dbo_session::get_object | ( | $ | type, | |
| $ | id | |||
| ) |
Get existing object from the session.
This is used internally by dbo::_get().
| type | [string] DBO object name. | |
| id | [int] DBO object id. |
| dbo_session::put_object | ( | dbo $ | obj | ) |
| dbo_session::set_object_name | ( | $ | obj, | |
| $ | name | |||
| ) |
| dbo_session::$context |
| dbo_session::$message |
[string|null] Commit error message.
dbo_session::$named_objects = array() [private] |
dbo_session::$new_objects = array() [private] |
dbo_session::$objects = array() [private] |
Referenced by commit().