src/Charcoal/Admin/Widget/ObjectFormWidget.php
protected function groupsConditionalLogic(array $groups = null)
    {
        if (!$groups) {
            $groups = iterator_to_array($this->groups());
        }

        $conditions = [];

        foreach ($groups as $group) {
            if ($group instanceof FormInterface) {
                $groupGroups = iterator_to_array($group->groups());
                if (!empty($groupGroups)) {
                    $conditions = array_merge(
                        $conditions,
                        $this->groupsConditionalLogic($groupGroups)
                    );
                }
            }

            if ($group instanceof FormGroupInterface && $group->conditionalLogic()) {
                $conditions = array_merge($conditions, $group->conditionalLogic());
            }
        }

        return $conditions;
    }
protected function groupsConditionalLogic(array $groups = null)
    {
        if (!$groups) {
            $groups = iterator_to_array($this->groups());
        }

        $conditions = [];

        foreach ($groups as $group) {
            if ($group instanceof FormInterface) {
                $groupGroups = iterator_to_array($group->groups());
                if (!empty($groupGroups)) {
                    $conditions = array_merge(
                        $conditions,
                        $this->groupsConditionalLogic($groupGroups)
                    );
                }
            }

            if ($group instanceof FormGroupInterface && $group->conditionalLogic()) {
                $conditions = array_merge($conditions, $group->conditionalLogic());
            }
        }

        return $conditions;
    }
protected function groupsConditionalLogic ( array $ groups = null ) { if ( ! $ groups ) { $ groups = iterator_to_array ( $ this -> groups ( ) ) ; } $ conditions = [ ] ; foreach ( $ groups as $ group ) { if ( $ group instanceof FormInterface ) { $ groupGroups = iterator_to_array ( $ group -> groups ( ) ) ; if ( ! empty ( $ groupGroups ) ) { $ conditions = array_merge ( $ conditions , $ this -> groupsConditionalLogic ( $ groupGroups ) ) ; } } if ( $ group instanceof FormGroupInterface && $ group -> conditionalLogic ( ) ) { $ conditions = array_merge ( $ conditions , $ group -> conditionalLogic ( ) ) ; } } return $ conditions ; }
Self recursive when a groups is an instance of FormInterface.

@param array|null $groups Form groups to parse.
@return array
Self recursive when a groups is an instance of FormInterface .