26 defined(
'LGV_DBF_CATCHER' ) or die ( 'Cannot Execute Directly' );
28 require_once(dirname(__FILE__).'/co_collection.class.php');
52 parent::__construct($in_db_object, $in_db_result);
53 $this->class_description =
"This is a class for doing \"key/value\" storage.";
55 if (NULL != $in_key) {
56 $this->set_key($in_key, $value);
57 } elseif (NULL != $in_value) {
58 $this->set_value($in_key, $value);
70 $ret = parent::load_from_db($in_db_result);
73 $this->class_description =
"This is a class for doing \"key/value\" storage.";
74 $this->instance_description = $this->name;
92 if ($this->user_can_write()) {
94 $instance_list = $this->get_access_object()->generic_search(Array(
'access_class' => get_class($this),
'tags' => Array($in_key)));
96 if (!isset($instance_list) || !is_array($instance_list) || !count($instance_list) || (1 == count($instance_list) && ($instance_list[0] === $this))) {
98 if (isset($instance_list) && is_array($instance_list) && (1 == count($instance_list) && ($instance_list[0] === $this))) {
101 $ret = $this->set_tag(0, $in_key);
104 if ($ret && (NULL != $in_value)) {
105 return $this->set_value($in_value);
122 return $this->tags[0];
130 return $this->get_payload();
138 return Array($this->get_key(), $this->get_value());
146 return Array($this->get_key() => $this->get_value());
157 if ($this->user_can_write()) {
158 $ret = $this->set_payload($in_value);
load_from_db( $in_db_result)
__construct( $in_db_object=NULL, $in_db_result=NULL, $in_key=NULL, $in_value=NULL)
set_key( $in_key, $in_value=NULL)
static $co_key_value_error_code_user_not_authorized
static $co_key_value_error_name_user_not_authorized
These apply to the KeyValue classes.
static $co_key_value_error_desc_user_not_authorized
This class provides a general error report, with file, method and error information.