diff options
author | Kirylka <kirylanoshko@gmail.com> | 2015-04-07 12:27:53 +0300 |
---|---|---|
committer | Kirylka <kirylanoshko@gmail.com> | 2015-04-07 12:27:53 +0300 |
commit | f70c0f119d3aeacbb30fa3ad65ed56cda9640d97 (patch) | |
tree | f1769b415e145da3a836a897450c118f4995d05a /codebase/Data/JSONCommonDataItem.php | |
parent | 9c5ae1267c676ca235efb8d78a206cb45d0d714c (diff) | |
download | connector-php-f70c0f119d3aeacbb30fa3ad65ed56cda9640d97.zip connector-php-f70c0f119d3aeacbb30fa3ad65ed56cda9640d97.tar.gz connector-php-f70c0f119d3aeacbb30fa3ad65ed56cda9640d97.tar.bz2 |
Webix grid support
Diffstat (limited to 'codebase/Data/JSONCommonDataItem.php')
-rw-r--r-- | codebase/Data/JSONCommonDataItem.php | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/codebase/Data/JSONCommonDataItem.php b/codebase/Data/JSONCommonDataItem.php new file mode 100644 index 0000000..4a69068 --- /dev/null +++ b/codebase/Data/JSONCommonDataItem.php @@ -0,0 +1,29 @@ +<?php +namespace DHTMLX\Connector\Data; + +class JSONCommonDataItem extends DataItem{ + /*! return self as XML string + */ + function to_xml(){ + if ($this->skip) return false; + + $data = array( + 'id' => $this->get_id() + ); + for ($i=0; $i<sizeof($this->config->text); $i++){ + $extra = $this->config->text[$i]["name"]; + $data[$extra]=$this->data[$extra]; + if (is_null($data[$extra])) + $data[$extra] = ""; + } + + if ($this->userdata !== false) + foreach ($this->userdata as $key => $value){ + if ($value === null) + $data[$key]=""; + $data[$key]=$value; + } + + return $data; + } +} |