26 defined(
'LGV_DBF_CATCHER' ) or die ( 'Cannot Execute Directly' );
28 CO_Config::require_extension_class('tco_collection.interface.php');
29 CO_Config::require_extension_class('co_us_place.class.php');
43 public function __construct( $in_db_object = NULL,
46 $in_tags_array = NULL,
61 $this->_container = Array();
63 parent::__construct($in_db_object, $in_db_result, $in_owner_id, $in_tags_array, $in_longitude, $in_latitude);
64 $this->class_description =
"This is a 'Place Collection' Class for US Addresses.";
73 public function load_from_db( $in_db_result
75 $ret = parent::load_from_db($in_db_result);
78 if (isset($this->context[
'children_ids']) && is_array($this->context[
'children_ids'])) {
79 $count = count($this->context[
'children_ids']);
82 $this->class_description =
"This is a 'Place Collection' Class for US Addresses.";
83 $this->instance_description = isset($this->name) && $this->name ?
"$this->name ($this->_longitude, $this->_latitude - $count children objects)" :
"($this->_longitude, $this->_latitude - $count children objects)";
91 public function delete_from_db( $with_extreme_prejudice =
false
93 if ($with_extreme_prejudice && $this->user_can_write()) {
95 $user_items_to_delete = $this->children();
97 foreach ($user_items_to_delete as $child) {
98 if ($child->user_can_write()) {
99 $child->delete_from_db();
104 return parent::delete_from_db();