src/Charcoal/Cms/Route/GenericRoute.php
protected function loadObjectRouteFromPath()
    {
        // Load current slug
        // Slugs are unique
        // Slug can be duplicated by adding the front "/" to it hence the order by last_modification_date
        $route = $this->createRouteObject();
        $route->loadFromQuery(
            'SELECT * FROM `'.$route->source()->table().'` WHERE (`slug` = :route1 OR `slug` = :route2) AND `lang` = :lang ORDER BY last_modification_date DESC LIMIT 1',
            [
                'route1' => '/'.$this->path(),
                'route2' => $this->path(),
                'lang'   => $this->translator()->getLocale()
            ]
        );

        return $route;
    }
protected function loadObjectRouteFromPath()
    {
        // Load current slug
        // Slugs are unique
        // Slug can be duplicated by adding the front "/" to it hence the order by last_modification_date
        $route = $this->createRouteObject();
        $route->loadFromQuery(
            'SELECT * FROM `'.$route->source()->table().'` WHERE (`slug` = :route1 OR `slug` = :route2) AND `lang` = :lang ORDER BY last_modification_date DESC LIMIT 1',
            [
                'route1' => '/'.$this->path(),
                'route2' => $this->path(),
                'lang'   => $this->translator()->getLocale()
            ]
        );

        return $route;
    }
protected function loadObjectRouteFromPath ( ) { // Load current slug // Slugs are unique // Slug can be duplicated by adding the front "/" to it hence the order by last_modification_date $ route = $ this -> createRouteObject ( ) ; $ route -> loadFromQuery ( 'SELECT * FROM `' . $ route -> source ( ) -> table ( ) . '` WHERE (`slug` = :route1 OR `slug` = :route2) AND `lang` = :lang ORDER BY last_modification_date DESC LIMIT 1' , [ 'route1' => '/' . $ this -> path ( ) , 'route2' => $ this -> path ( ) , 'lang' => $ this -> translator ( ) -> getLocale ( ) ] ) ; return $ route ; }
Load the object route matching the URI path.

@return \Charcoal\Object\ObjectRouteInterface
Load the object route matching the URI path .