eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Mapper::matchTypeAndDestination PHP Метод

matchTypeAndDestination() защищенный Метод

protected matchTypeAndDestination ( string $action ) : array
$action string
Результат array
    protected function matchTypeAndDestination($action)
    {
        if (preg_match('#^([a-zA-Z0-9_]+):(.+)?$#', $action, $matches)) {
            $actionType = $matches[1];
            $actionValue = isset($matches[2]) ? $matches[2] : false;
            switch ($actionType) {
                case 'eznode':
                    $type = UrlAlias::LOCATION;
                    $destination = $actionValue;
                    break;
                case 'module':
                    $type = UrlAlias::RESOURCE;
                    $destination = $actionValue;
                    break;
                case 'nop':
                    $type = UrlAlias::VIRTUAL;
                    $destination = null;
                    break;
                default:
                    // @todo log message
                    throw new \RuntimeException("Action type '{$actionType}' is unknown");
            }
        } else {
            // @todo log message
            throw new \RuntimeException("Action '{$action}' is not valid");
        }
        return array($type, $destination);
    }