WellCommerce\Bundle\LocaleBundle\Entity\Locale::getCode PHP Method

getCode() public method

public getCode ( ) : string
return string
    public function getCode() : string
    {
        return $this->code;
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Returns category slug
  *
  * @param Locale $locale
  * @param string $categoryName
  *
  * @return mixed|string
  */
 protected function getLocaleSlug(Locale $locale, $categoryName)
 {
     $slug = Sluggable::makeSlug($categoryName);
     $currentLocale = $this->getRequestHelper()->getCurrentLocale();
     if ($locale->getCode() != $currentLocale) {
         $slug = Sluggable::makeSlug(sprintf('%s-%s', $categoryName, $locale->getCode()));
     }
     return $slug;
 }