summaryrefslogtreecommitdiffstats
path: root/codebase/Dhtmlx/Connector/DataViewConnector.php
diff options
context:
space:
mode:
authorEgor <egor.26.93@gmail.com>2015-06-12 16:06:06 +0300
committerEgor <egor.26.93@gmail.com>2015-06-12 16:06:06 +0300
commit9abd184a386a2594398df9f5cd7bd6d5b9c240fc (patch)
tree6b237196dd4ae8bdee61093308f5c3dcdcc5c79e /codebase/Dhtmlx/Connector/DataViewConnector.php
parent5fbd0adda5155853e86001fad4c571008f09f01b (diff)
downloadconnector-php-9abd184a386a2594398df9f5cd7bd6d5b9c240fc.zip
connector-php-9abd184a386a2594398df9f5cd7bd6d5b9c240fc.tar.gz
connector-php-9abd184a386a2594398df9f5cd7bd6d5b9c240fc.tar.bz2
Updated structure. Added connectors.
Diffstat (limited to 'codebase/Dhtmlx/Connector/DataViewConnector.php')
-rw-r--r--codebase/Dhtmlx/Connector/DataViewConnector.php49
1 files changed, 49 insertions, 0 deletions
diff --git a/codebase/Dhtmlx/Connector/DataViewConnector.php b/codebase/Dhtmlx/Connector/DataViewConnector.php
new file mode 100644
index 0000000..167bd3b
--- /dev/null
+++ b/codebase/Dhtmlx/Connector/DataViewConnector.php
@@ -0,0 +1,49 @@
+<?php
+namespace Dhtmlx\Connector;
+
+/*! Connector class for DataView
+**/
+class DataViewConnector extends Connector {
+ /*! constructor
+
+ Here initilization of all Masters occurs, execution timer initialized
+ @param res
+ db connection resource
+ @param type
+ string , which hold type of database ( MySQL or Postgre ), optional, instead of short DB name, full name of DataWrapper-based class can be provided
+ @param item_type
+ name of class, which will be used for item rendering, optional, DataItem will be used by default
+ @param data_type
+ name of class which will be used for dataprocessor calls handling, optional, DataProcessor class will be used by default.
+ */
+ public function __construct($res,$type=false,$item_type=false,$data_type=false){
+ if (!$item_type) $item_type="DataViewDataItem";
+ if (!$data_type) $data_type="DataProcessor";
+ parent::__construct($res,$type,$item_type,$data_type);
+ }
+
+ //parse GET scoope, all operations with incoming request must be done here
+ function parse_request(){
+ parent::parse_request();
+
+ if (isset($_GET["posStart"]) && isset($_GET["count"]))
+ $this->request->set_limit($_GET["posStart"],$_GET["count"]);
+ }
+
+ /*! renders self as xml, starting part
+ */
+ protected function xml_start(){
+ $attributes = "";
+ foreach($this->attributes as $k=>$v)
+ $attributes .= " ".$k."='".$v."'";
+
+ if ($this->dload){
+ if ($pos=$this->request->get_start())
+ return "<data pos='".$pos."'".$attributes.">";
+ else
+ return "<data total_count='".$this->sql->get_size($this->request)."'".$attributes.">";
+ }
+ else
+ return "<data".$attributes.">";
+ }
+} \ No newline at end of file