summaryrefslogtreecommitdiff
path: root/fai_gestion/plugins/CustomTheme/src/View/Helper/BakeExtraHelper.php
diff options
context:
space:
mode:
Diffstat (limited to 'fai_gestion/plugins/CustomTheme/src/View/Helper/BakeExtraHelper.php')
-rw-r--r--fai_gestion/plugins/CustomTheme/src/View/Helper/BakeExtraHelper.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/fai_gestion/plugins/CustomTheme/src/View/Helper/BakeExtraHelper.php b/fai_gestion/plugins/CustomTheme/src/View/Helper/BakeExtraHelper.php
index eb4b1df..44b28d4 100644
--- a/fai_gestion/plugins/CustomTheme/src/View/Helper/BakeExtraHelper.php
+++ b/fai_gestion/plugins/CustomTheme/src/View/Helper/BakeExtraHelper.php
@@ -120,6 +120,29 @@ class BakeExtraHelper extends Helper
return Hash::get($this->_config, "templateExtra.$controllerName.order");
}
+ public function hasOrderContains($controllerName) {
+ if ( ! is_string($controllerName) ) return FALSE;
+ $orderContains = $this->getOrderContains($controllerName);
+ return (is_array($orderContains) && count($orderContains) > 0);
+ }
+
+ public function getOrderContains($controllerName) {
+ if ( ! is_string($controllerName) ) return FALSE;
+ $orderOpts = $this->getOrderOpts($controllerName);
+ $contains = collection(array_keys($orderOpts))
+ ->map(
+ function ($item, $key) use ($controllerName) {
+ $alias = substr($item, 0, strpos($item, '.'));
+ return ($alias===$controllerName)?FALSE:$alias;
+ }
+ )->filter(
+ function ($item, $key) {
+ return $item !== FALSE;
+ }
+ )->toArray();
+ return $contains;
+ }
+
public function hasOrderHooks($controllerName) {
if ( ! is_string($controllerName) ) return FALSE;
$orderHooks = $this->getOrderHooks($controllerName);