FOF30\Configuration\Domain\Views::getTaskmap PHP Method

getTaskmap() protected method

Internal function to return the task map for a view
protected getTaskmap ( string $view, &$configuration, array $params, array $default = [] ) : array
$view string The view for which we will be fetching a task map
$params array Extra options (not used)
$default array ßDefault task map; empty array if not provided
return array The task map as a hash array in the format task => method
    protected function getTaskmap($view, &$configuration, $params, $default = array())
    {
        $taskmap = array();
        if (isset($configuration['views']['*']) && isset($configuration['views']['*']['taskmap'])) {
            $taskmap = $configuration['views']['*']['taskmap'];
        }
        if (isset($configuration['views'][$view]) && isset($configuration['views'][$view]['taskmap'])) {
            $taskmap = array_merge($taskmap, $configuration['views'][$view]['taskmap']);
        }
        if (empty($taskmap)) {
            return $default;
        }
        return $taskmap;
    }