浏览代码

groups filter

tags/0.1.0
Robin Thoni 8 年前
父节点
当前提交
ba2119bb3a
共有 2 个文件被更改,包括 8 次插入2 次删除
  1. 3
    2
      src/Auth/Controller/LuticateGroupsController.php
  2. 5
    0
      src/Auth/DataAccess/LuticateGroupsDataAccess.php

+ 3
- 2
src/Auth/Controller/LuticateGroupsController.php 查看文件

@@ -26,11 +26,12 @@ class LuticateGroupsController extends LuController {
26 26
      * Get all groups
27 27
      * @param int $page The page number, 0 based
28 28
      * @param int $perPage The number of items per page
29
+     * @param string $query The filter query
29 30
      * @return \Luticate\Utils\LuMultipleDbo
30 31
      */
31
-    public function getAll($page = 0, $perPage = PHP_INT_MAX)
32
+    public function getAll($page = 0, $perPage = PHP_INT_MAX, $query = "")
32 33
     {
33
-        return LuticateGroupsBusiness::getAll($page, $perPage);
34
+        return LuticateGroupsBusiness::getAll($page, $perPage, $query);
34 35
     }
35 36
 
36 37
     /**

+ 5
- 0
src/Auth/DataAccess/LuticateGroupsDataAccess.php 查看文件

@@ -20,6 +20,11 @@ class LuticateGroupsDataAccess extends LuDataAccess {
20 20
         return array(array("name", "ASC"));
21 21
     }
22 22
 
23
+    protected static function getQueryPredicate($query)
24
+    {
25
+        return array(array("name", "ilike", "%" . $query . "%", "or"));
26
+    }
27
+
23 28
     /**
24 29
      * @param $group_name
25 30
      * @return LuticateGroupsDbo|null

正在加载...
取消
保存