diff options
author | Kirylka <kirylanoshko@gmail.com> | 2015-03-31 17:56:47 +0300 |
---|---|---|
committer | Kirylka <kirylanoshko@gmail.com> | 2015-03-31 17:56:47 +0300 |
commit | f5f99c335707d9b11d40f1eb0f6ddb5a993fd31a (patch) | |
tree | d9c0d3532ec9f0f2fb68e31d2611282ae0642181 /codebase/Event/SortInterface.php | |
parent | 458f0aead573842f1df00ce2ae00334c27f66585 (diff) | |
download | connector-php-f5f99c335707d9b11d40f1eb0f6ddb5a993fd31a.zip connector-php-f5f99c335707d9b11d40f1eb0f6ddb5a993fd31a.tar.gz connector-php-f5f99c335707d9b11d40f1eb0f6ddb5a993fd31a.tar.bz2 |
Creating a new connector for yii2.
Diffstat (limited to 'codebase/Event/SortInterface.php')
-rw-r--r-- | codebase/Event/SortInterface.php | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/codebase/Event/SortInterface.php b/codebase/Event/SortInterface.php new file mode 100644 index 0000000..5e6aef4 --- /dev/null +++ b/codebase/Event/SortInterface.php @@ -0,0 +1,31 @@ +<?php + +namespace DHTMLX\Connector\Event; + +class SortInterface extends EventInterface{ + /*! constructor + creates a new interface based on existing request + @param request + DataRequestConfig object + */ + public function __construct($request){ + parent::__construct($request); + $this->rules = &$request->get_sort_by_ref(); + } + /*! add new sorting rule + + @param name + name of field + @param dir + direction of sorting + */ + public function add($name,$dir){ + if ($dir === false) + $this->request->set_sort($name); + else + $this->request->set_sort($name,$dir); + } + public function store(){ + $this->request->set_sort_by($this->rules); + } +}
\ No newline at end of file |