Browse Source

added text filter in getAll

tags/0.1.0
Robin Thoni 9 years ago
parent
commit
0688568fb4
2 changed files with 13 additions and 4 deletions
  1. 2
    2
      src/Utils/LuBusiness.php
  2. 11
    2
      src/Utils/LuDataAccess.php

+ 2
- 2
src/Utils/LuBusiness.php View File

@@ -134,9 +134,9 @@ abstract class LuBusiness {
134 134
         return null;
135 135
     }
136 136
 
137
-    public static function getAll($page = 0, $perPage = PHP_INT_MAX)
137
+    public static function getAll($page = 0, $perPage = PHP_INT_MAX, $query = "")
138 138
     {
139
-        return static::getDataAccess()->getAll($page, $perPage);
139
+        return static::getDataAccess()->getAll($page, $perPage, $query);
140 140
     }
141 141
 
142 142
     public static function getResourceName()

+ 11
- 2
src/Utils/LuDataAccess.php View File

@@ -122,8 +122,17 @@ abstract class LuDataAccess {
122 122
         return array();
123 123
     }
124 124
 
125
-    public static function getAll($page = 0, $perPage = PHP_INT_MAX)
125
+    /**
126
+     * @param $query
127
+     * @return array
128
+     */
129
+    protected static function getQueryPredicate($query)
130
+    {
131
+        return array();
132
+    }
133
+
134
+    public static function getAll($page = 0, $perPage = PHP_INT_MAX, $query = "")
126 135
     {
127
-        return self::getMultiple(array(), static::getOrderBy(), $page, $perPage);
136
+        return self::getMultiple(static::getQueryPredicate($query), static::getOrderBy(), $page, $perPage);
128 137
     }
129 138
 }

Loading…
Cancel
Save