src/Zicht/Bundle/MenuBundle/Url/MenuItemNameUrlProvider.php
protected function loadMappings()
    {
        // using a subquery to allow for FETCH_KEY_PAIR
        $query = '
            SELECT
                name, path
            FROM (
                SELECT
                    menu_item.name,
                    menu_item.path,
                    COALESCE(menu_item.language, root_item.language) language
                FROM
                    menu_item INNER JOIN menu_item root_item ON (menu_item.root=root_item.id)
                WHERE
                    menu_item.path IS NOT NULL
                    AND menu_item.name IS NOT NULL AND LENGTH(menu_item.name) > 0
                HAVING
                    language IS NULL OR language=:lang
            ) s
            ORDER BY
                language=:lang DESC
        ';
        $stmt = $this->em->getConnection()->prepare($query);
        $stmt->execute([':lang' => $this->router->getContext()->getParameter('_locale')]);
        $this->addAll($stmt->fetchAll(\PDO::FETCH_KEY_PAIR));
    }
protected function loadMappings()
    {
        // using a subquery to allow for FETCH_KEY_PAIR
        $query = '
            SELECT
                name, path
            FROM (
                SELECT
                    menu_item.name,
                    menu_item.path,
                    COALESCE(menu_item.language, root_item.language) language
                FROM
                    menu_item INNER JOIN menu_item root_item ON (menu_item.root=root_item.id)
                WHERE
                    menu_item.path IS NOT NULL
                    AND menu_item.name IS NOT NULL AND LENGTH(menu_item.name) > 0
                HAVING
                    language IS NULL OR language=:lang
            ) s
            ORDER BY
                language=:lang DESC
        ';
        $stmt = $this->em->getConnection()->prepare($query);
        $stmt->execute([':lang' => $this->router->getContext()->getParameter('_locale')]);
        $this->addAll($stmt->fetchAll(\PDO::FETCH_KEY_PAIR));
    }
protected function loadMappings ( ) { // using a subquery to allow for FETCH_KEY_PAIR $ query = '
            SELECT
                name, path
            FROM (
                SELECT
                    menu_item.name,
                    menu_item.path,
                    COALESCE(menu_item.language, root_item.language) language
                FROM
                    menu_item INNER JOIN menu_item root_item ON (menu_item.root=root_item.id)
                WHERE
                    menu_item.path IS NOT NULL
                    AND menu_item.name IS NOT NULL AND LENGTH(menu_item.name) > 0
                HAVING
                    language IS NULL OR language=:lang
            ) s
            ORDER BY
                language=:lang DESC
        ' ; $ stmt = $ this -> em -> getConnection ( ) -> prepare ( $ query ) ; $ stmt -> execute ( [ ':lang' => $ this -> router -> getContext ( ) -> getParameter ( '_locale' ) ] ) ; $ this -> addAll ( $ stmt -> fetchAll ( \ PDO :: FETCH_KEY_PAIR ) ) ; }
Loads all mappings from the url, based on the current request locale.
Loads all mappings from the url based on the current request locale .