FOF30\Configuration\Domain\Models::getBehaviors PHP Method

getBehaviors() protected method

Internal method to get model behaviours
protected getBehaviors ( string $model, &$configuration, array $params, string $default = '' ) : string
$model string The model for which we will be fetching behaviours
$params array Unused
$default string Default behaviour
return string Model behaviours
    protected function getBehaviors($model, &$configuration, $params, $default = '')
    {
        $behaviors = $default;
        if (isset($configuration['models']['*']) && isset($configuration['models']['*']['behaviors'])) {
            $behaviors = $configuration['models']['*']['behaviors'];
        }
        if (isset($configuration['models'][$model]) && isset($configuration['models'][$model]['behaviors'])) {
            $merge = false;
            if (isset($configuration['models'][$model]) && isset($configuration['models'][$model]['behaviorsMerge'])) {
                $merge = (bool) $configuration['models'][$model]['behaviorsMerge'];
            }
            if ($merge) {
                $behaviors = array_merge($behaviors, $configuration['models'][$model]['behaviors']);
            } else {
                $behaviors = $configuration['models'][$model]['behaviors'];
            }
        }
        return $behaviors;
    }