26 defined(
'LGV_DBF_CATCHER' ) or die ( 'Cannot Execute Directly' );
28 if ( !defined('LGV_ADBTB_CATCHER') ) {
29 define(
'LGV_ADBTB_CATCHER', 1);
32 require_once(CO_Config::db_class_dir().
'/a_co_db_table_base.class.php');
54 $default_setup = parent::_default_setup();
57 for ($tag_no = 0; $tag_no < 10; $tag_no++) {
59 $tag_val = (isset($this->_tags) && is_array($this->_tags) && ($tag_no < count($this->_tags))) ? $this->_tags[$tag_no] :
'';
60 $default_setup[$key] = $tag_val;
63 return $default_setup;
73 $ret = parent::_build_parameter_array();
75 $ret[
'owner'] = intval($this->_owner_id);
76 for ($tag_no = 0; $tag_no < 10; $tag_no++) {
78 if (isset($this->_tags[$tag_no])) {
79 $ret[$key] = $this->_tags[$tag_no];
85 $ret[
'payload'] = base64_encode($this->_raw_payload);
100 $this->_owner_id = intval($in_owner_id);
101 $this->_tags = (isset($in_tags_array) && is_array($in_tags_array) && count($in_tags_array)) ? array_map(
function($in) {
return strval($in); }, $in_tags_array) : Array();
102 parent::__construct($in_db_object, $in_db_result);
103 $this->class_description =
'Base Class for Main Database Records.';
104 $this->name = (isset($this->name) && trim($this->name)) ? trim($this->name) :
"Base Class Instance ($this->_id)";
115 $ret = parent::load_from_db($in_db_result);
118 $this->class_description =
'Base Class for Main Database Records.';
119 $this->name = (isset($this->name) && trim($this->name)) ? trim($this->name) :
"Base Class Instance ($this->_id)";
121 if ($this->_db_object) {
122 $this->_owner_id = NULL;
123 $this->_tags = array();
124 $this->_raw_payload = NULL;
126 if (isset($in_db_result[
'owner'])) {
127 $this->_owner_id = intval($in_db_result[
'owner']);
130 if (isset($in_db_result[
'payload']) ) {
131 $payload = $in_db_result[
'payload'];
132 $length = strlen($payload);
137 while($counter < $length) {
138 $this_chunk = substr($payload, $counter, 4096);
139 $new_payload[] = base64_decode($this_chunk);
143 $this->_raw_payload = implode(
'', $new_payload);
146 for ($tag_no = 0; $tag_no < 10; $tag_no++) {
148 $tag_val = (isset($in_db_result[$key])) && $in_db_result[$key] ? $in_db_result[$key] :
'';
149 $this->_tags[$tag_no] = $tag_val;
152 for ($i = 0; $i < 10; $i++) {
154 $this->_tags[$i] =
'';
155 if (isset($in_db_result[$tagname])) {
156 $this->_tags[$i] = $in_db_result[$tagname];
176 $this->_owner_id = intval($in_new_id);
193 if (isset($in_tags_array) && is_array($in_tags_array) && count($in_tags_array) && (11 > count($in_tags_array)) && $this->
user_can_write()) {
194 $this->_tags = array_map(
'strval', $in_tags_array);
212 $in_tag_index = intval($in_tag_index);
215 if (!isset($this->_tags) || !$this->_tags) {
216 $this->_tags = Array();
219 $this->_tags[$in_tag_index] = (NULL != $in_tag_value) ? strval($in_tag_value) : NULL;
247 $this->_raw_payload = $in_payload;
if(!defined( 'LGV_ADBTB_CATCHER'))
set_tag( $in_tag_index, $in_tag_value)
set_owner_id( $in_new_id)
load_from_db( $in_db_result)
set_payload( $in_payload)
set_tags( $in_tags_array)
__construct( $in_db_object=NULL, $in_db_result=NULL, $in_owner_id=NULL, $in_tags_array=NULL)