summaryrefslogtreecommitdiffstats
path: root/codebase/Dhtmlx/Connector/OptionsConnector.php
blob: 0fb1e4e46d656443d6ae1b3316953c54d52909dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
namespace Dhtmlx\Connector;

/*! wrapper around options collection, used for comboboxes and filters
**/
class OptionsConnector extends Connector {
    protected $init_flag=false;//!< used to prevent rendering while initialization
    public function __construct($res,$type=false,$item_type=false,$data_type=false){
        if (!$item_type) $item_type="Dhtmlx\\Connector\\Data\\DataItem";
        if (!$data_type) $data_type=""; //has not sense, options not editable
        parent::__construct($res,$type,$item_type,$data_type);
    }
    /*! render self
        process commands, return data as XML, not output data to stdout, ignore parameters in incoming request
        @return
            data as XML string
    */
    public function render(){
        if (!$this->init_flag){
            $this->init_flag=true;
            return "";
        }
        $res = $this->sql->select($this->request);
        return $this->render_set($res);
    }
}