@@ 1236-1247 (lines=12) @@ | ||
1233 | * @return Filter\FilterSelect |
|
1234 | * @throws DataGridException |
|
1235 | */ |
|
1236 | public function addFilterSelect($key, $name, array $options, $column = null) |
|
1237 | { |
|
1238 | $column = $column ?: $key; |
|
1239 | ||
1240 | if (!is_string($column)) { |
|
1241 | throw new DataGridException('Filter Select can only filter in one column.'); |
|
1242 | } |
|
1243 | ||
1244 | $this->addFilterCheck($key); |
|
1245 | ||
1246 | return $this->filters[$key] = new Filter\FilterSelect($this, $key, $name, $options, $column); |
|
1247 | } |
|
1248 | ||
1249 | ||
1250 | /** |
|
@@ 1259-1270 (lines=12) @@ | ||
1256 | * @return Filter\FilterSelect |
|
1257 | * @throws DataGridException |
|
1258 | */ |
|
1259 | public function addFilterMultiSelect($key, $name, array $options, $column = null) |
|
1260 | { |
|
1261 | $column = $column ?: $key; |
|
1262 | ||
1263 | if (!is_string($column)) { |
|
1264 | throw new DataGridException('Filter MultiSelect can only filter in one column.'); |
|
1265 | } |
|
1266 | ||
1267 | $this->addFilterCheck($key); |
|
1268 | ||
1269 | return $this->filters[$key] = new Filter\FilterMultiSelect($this, $key, $name, $options, $column); |
|
1270 | } |
|
1271 | ||
1272 | ||
1273 | /** |
|
@@ 1281-1292 (lines=12) @@ | ||
1278 | * @return Filter\FilterDate |
|
1279 | * @throws DataGridException |
|
1280 | */ |
|
1281 | public function addFilterDate($key, $name, $column = null) |
|
1282 | { |
|
1283 | $column = $column ?: $key; |
|
1284 | ||
1285 | if (!is_string($column)) { |
|
1286 | throw new DataGridException('FilterDate can only filter in one column.'); |
|
1287 | } |
|
1288 | ||
1289 | $this->addFilterCheck($key); |
|
1290 | ||
1291 | return $this->filters[$key] = new Filter\FilterDate($this, $key, $name, $column); |
|
1292 | } |
|
1293 | ||
1294 | ||
1295 | /** |
|
@@ 1303-1314 (lines=12) @@ | ||
1300 | * @return Filter\FilterRange |
|
1301 | * @throws DataGridException |
|
1302 | */ |
|
1303 | public function addFilterRange($key, $name, $column = null, $name_second = '-') |
|
1304 | { |
|
1305 | $column = $column ?: $key; |
|
1306 | ||
1307 | if (!is_string($column)) { |
|
1308 | throw new DataGridException('FilterRange can only filter in one column.'); |
|
1309 | } |
|
1310 | ||
1311 | $this->addFilterCheck($key); |
|
1312 | ||
1313 | return $this->filters[$key] = new Filter\FilterRange($this, $key, $name, $column, $name_second); |
|
1314 | } |
|
1315 | ||
1316 | ||
1317 | /** |
|
@@ 1325-1336 (lines=12) @@ | ||
1322 | * @return Filter\FilterDateRange |
|
1323 | * @throws DataGridException |
|
1324 | */ |
|
1325 | public function addFilterDateRange($key, $name, $column = null, $name_second = '-') |
|
1326 | { |
|
1327 | $column = $column ?: $key; |
|
1328 | ||
1329 | if (!is_string($column)) { |
|
1330 | throw new DataGridException('FilterDateRange can only filter in one column.'); |
|
1331 | } |
|
1332 | ||
1333 | $this->addFilterCheck($key); |
|
1334 | ||
1335 | return $this->filters[$key] = new Filter\FilterDateRange($this, $key, $name, $column, $name_second); |
|
1336 | } |
|
1337 | ||
1338 | ||
1339 | /** |