getLocale() public method

public getLocale ( ) : string
return string
コード例 #1
0
 /**
  * {@inheritdoc}
  */
 public function generate(RouteInterface $resource)
 {
     $this->defaults['id'] = $resource->getIdentifier()->getId();
     $this->defaults['_locale'] = $resource->getLocale();
     return new SymfonyRoute($resource->getPath(), $this->defaults, $this->requirements, $this->options);
 }
コード例 #2
0
 private function prepareRouteDefaults(RouteInterface $resource)
 {
     $this->defaults['id'] = $resource->getIdentifier()->getId();
     $this->defaults['_locale'] = $resource->getLocale();
 }
コード例 #3
0
 /**
  * Checks passed identifier and locale against those in route
  *
  * @param RouteInterface $route
  * @param                $locale
  * @param                $id
  *
  * @return bool
  */
 protected function hasRouteSameLocaleAndId(RouteInterface $route, $locale, $id)
 {
     return $route->getIdentifier()->getId() === $id && $route->getLocale() === $locale;
 }
コード例 #4
0
 /**
  * Checks passed identifier and locale against those in route
  *
  * @param RouteInterface $route
  * @param                $locale
  * @param                $id
  *
  * @return bool
  */
 private function hasRouteSameLocaleAndId(RouteInterface $route, string $locale, $id) : bool
 {
     return $route->getIdentifier()->getId() === $id && $route->getLocale() === $locale;
 }