| $def | |
| [dbo_bag_def] Bag description object. | |
| __construct (dbo $owner, dbo_bag_def $def) | |
| Constructor. | |
| load ($full=false) | |
| Load information into bag. | |
| add () | |
| Add object into the bag. | |
| set () | |
| Add object into the bag and remove existing ones. | |
| find_object_index ($obj) | |
| Find object's index in the bag by object instance. | |
| find_oid_index ($oid) | |
| Find object's index in the bag by ID. | |
| find_index ($arg) | |
| Find index of object or OID in the bag. | |
| find_object ($oid) | |
| Find object in the bag by its OID. | |
| count () | |
| Get number of items in the container. | |
| create () | |
| Create new item and add it to the bag. | |
| move_object_after ($id, $ref_id) | |
| Move object with id after object with ref_id. | |
| remove_all ($deep=false) | |
| Remove all objects from the bag. | |
| remove ($index, $deep=false) | |
| Remove one object from the bag. | |
| get ($index=null) | |
| Get DBO from the container using it's index. | |
| get_single () | |
| Get single DBO from the container. | |
| get_iterator () | |
| Get DBO objects iterator for bag items. | |
| get_ids_iterator () | |
| Get DBO objects ID iterator for bag items. | |
| check () | |
| Check bag for constraints. | |
| move_index_after ($item_idx, $after_idx) | |
| Move item with index $item_idx after item with index $after_idx. | |
| changed () | |
| Check if DBO bag differs from the stored state. | |
| dump () | |
| Dump internal data. |
It can be in following states:
| dbo_bag::__construct | ( | dbo $ | owner, | |
| dbo_bag_def $ | def | |||
| ) |
| dbo_bag::add | ( | ) |
Add object into the bag.
Parameters to this function may be:
| Exception | on any error. |
References count(), find_object_index(), and load().
| dbo_bag::changed | ( | ) |
Check if DBO bag differs from the stored state.
References count().
| dbo_bag::check | ( | ) |
Check bag for constraints.
References count().
| dbo_bag::count | ( | ) |
Get number of items in the container.
References load().
Referenced by add(), changed(), check(), and get_single().
| dbo_bag::create | ( | ) |
| dbo_bag::dump | ( | ) |
Dump internal data.
Useful for debugging.
| dbo_bag::find_index | ( | $ | arg | ) |
Find index of object or OID in the bag.
| arg | [int|dbo] Argument (OID or object). |
| Exception | on error. |
References find_object_index(), and find_oid_index().
Referenced by move_object_after().
| dbo_bag::find_object | ( | $ | oid | ) |
Find object in the bag by its OID.
| oid | [int] Object ID. |
| Exception | on error. |
References find_oid_index().
| dbo_bag::find_object_index | ( | $ | obj | ) |
Find object's index in the bag by object instance.
| obj | [dbo] DBO instance. |
References load().
Referenced by add(), and find_index().
| dbo_bag::find_oid_index | ( | $ | oid | ) |
Find object's index in the bag by ID.
| oid | [int] Object ID. |
References load().
Referenced by find_index(), and find_object().
| dbo_bag::get | ( | $ | index = null |
) |
Get DBO from the container using it's index.
| index | [int] Index of the item. |
References get_single(), and load().
| dbo_bag::get_ids_iterator | ( | ) |
Get DBO objects ID iterator for bag items.
This function does not return objects that are not yet in DB.
References load().
| dbo_bag::get_iterator | ( | ) |
| dbo_bag::get_single | ( | ) |
| dbo_bag::load | ( | $ | full = false |
) |
Load information into bag.
We are sure that objects array is always empty when this function is called and state is INIT.
| full | [boolean] If true, bag is loaded fully. If false, only object ids are loaded. |
Referenced by add(), count(), find_object_index(), find_oid_index(), get(), get_ids_iterator(), get_iterator(), get_single(), remove(), and remove_all().
| dbo_bag::move_index_after | ( | $ | item_idx, | |
| $ | after_idx | |||
| ) |
Move item with index $item_idx after item with index $after_idx.
| item_idx | [string] Item index. | |
| after_idx | [string] Reference item index. |
Referenced by move_object_after().
| dbo_bag::move_object_after | ( | $ | id, | |
| $ | ref_id | |||
| ) |
Move object with id after object with ref_id.
| id | [int] Object ID. | |
| ref_id | [int|null] If null, then move at the end, if -1 than at the beginning. |
References find_index(), and move_index_after().
| dbo_bag::remove | ( | $ | index, | |
| $ | deep = false | |||
| ) |
Remove one object from the bag.
| index | [int] Index of the object that should be removed. | |
| deep | [boolean] If true, objects are also removed using dbo::remove(), otherwise only their link to the bag is removed. |
References load().
| dbo_bag::remove_all | ( | $ | deep = false |
) |
Remove all objects from the bag.
| deep | [boolean] If true, objects are also removed using dbo::remove(), otherwise only their link to the bag is removed. |
References load().
Referenced by set().
| dbo_bag::set | ( | ) |
Add object into the bag and remove existing ones.
Parameters to this function are same as to dbo_bag::add().
| Exception | on any error. |
References remove_all().
| dbo_bag::$def |
[dbo_bag_def] Bag description object.