summaryrefslogtreecommitdiff
path: root/fai_gestion/plugins/CustomTheme/src/Template/Bake/Model
diff options
context:
space:
mode:
authorLudovic Pouzenc <ludovic@pouzenc.fr>2018-07-20 00:41:45 +0200
committerLudovic Pouzenc <ludovic@pouzenc.fr>2018-07-20 00:41:45 +0200
commitb59164b0b7451905adcca244e6395281eb0633ca (patch)
tree098111b525b796221a931aaae5c1688cf1a45d88 /fai_gestion/plugins/CustomTheme/src/Template/Bake/Model
parent76ab63096a25f5bf7b9d076cdc9ab3fc5218d216 (diff)
downloadchd_gestion-b59164b0b7451905adcca244e6395281eb0633ca.zip
chd_gestion-b59164b0b7451905adcca244e6395281eb0633ca.tar.gz
chd_gestion-b59164b0b7451905adcca244e6395281eb0633ca.tar.bz2
bake add Search filter support
Diffstat (limited to 'fai_gestion/plugins/CustomTheme/src/Template/Bake/Model')
-rw-r--r--fai_gestion/plugins/CustomTheme/src/Template/Bake/Model/table.twig18
1 files changed, 18 insertions, 0 deletions
diff --git a/fai_gestion/plugins/CustomTheme/src/Template/Bake/Model/table.twig b/fai_gestion/plugins/CustomTheme/src/Template/Bake/Model/table.twig
index 2ef02e9..fb3a417 100644
--- a/fai_gestion/plugins/CustomTheme/src/Template/Bake/Model/table.twig
+++ b/fai_gestion/plugins/CustomTheme/src/Template/Bake/Model/table.twig
@@ -156,4 +156,22 @@ class {{ name }}Table extends Table
return '{{ connection }}';
}
{% endif %}
+
+{%- if BakeExtra.hasFilters(name) %}
+
+ /**
+ * @return \Search\Manager
+ */
+ public function searchManager()
+ {
+ $searchManager = $this->behaviors()->Search->searchManager();
+{% for k, filter in BakeExtra.getFilters(name) %}
+ $searchManager->{{ filter.mode }}('{{ k }}', [
+ {{- BakeExtra.stringifySearchManagerConfig(filter)|raw -}}
+ ]);
+{% endfor %}
+
+ return $searchManager;
+ }
+{% endif %}
}