summaryrefslogtreecommitdiffstats
path: root/codebase/Data/JSONCommonDataItem.php
diff options
context:
space:
mode:
authorKirylka <kirylanoshko@gmail.com>2015-04-07 12:27:53 +0300
committerKirylka <kirylanoshko@gmail.com>2015-04-07 12:27:53 +0300
commitf70c0f119d3aeacbb30fa3ad65ed56cda9640d97 (patch)
treef1769b415e145da3a836a897450c118f4995d05a /codebase/Data/JSONCommonDataItem.php
parent9c5ae1267c676ca235efb8d78a206cb45d0d714c (diff)
downloadconnector-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.php29
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;
+ }
+}