26 defined(
'LGV_DBF_CATCHER' ) or die ( 'Cannot Execute Directly' );
28 require_once(CO_Config::db_class_dir().'/co_main_db_record.class.php');
29 CO_Config::require_extension_class('tco_collection.interface.php');
43 public function __construct( $in_db_object = NULL,
49 $this->_container = Array();
51 parent::__construct($in_db_object, $in_db_result, $in_owner_id, $in_tags_array);
52 $this->class_description =
"This is a 'Generic Collection' Class.";
61 public function load_from_db( $in_db_result
63 $ret = parent::load_from_db($in_db_result);
67 if (isset($this->context[
'children_ids']) && is_array($this->context[
'children_ids'])) {
68 $count = count($this->context[
'children_ids']);
71 $this->class_description =
"This is a 'Generic Collection' Class.";
72 $this->instance_description = isset($this->name) && $this->name ?
"$this->name" :
"Generic Collection Object";
83 public function delete_from_db( $with_extreme_prejudice =
false
85 if ($with_extreme_prejudice && $this->user_can_write()) {
87 $user_items_to_delete = $this->children();
89 foreach ($user_items_to_delete as $child) {
90 if ($child->user_can_write()) {
91 $child->delete_from_db();
96 return parent::delete_from_db();