public function getByName($name, $global = false)
    {
        $actions = $global ? $this->getGlobalActions() : $this->getActions();

        //loop over the actions to find our culprit
        foreach ($actions as $action) {
            if ($action->getOption('action_name') === $name) {
                return $action;
            }
        }

        return false;
    }