Skip to content

Instantly share code, notes, and snippets.

@koyablue
Created November 4, 2021 08:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koyablue/05956c45ab6f0dcd4531d471c5fc6d28 to your computer and use it in GitHub Desktop.
Save koyablue/05956c45ab6f0dcd4531d471c5fc6d28 to your computer and use it in GitHub Desktop.
<?php
namespace App\Packages\FrontPage\Home\UseCase;
use App\Packages\FrontPage\Shared\Domain\Models\Locale;
use App\Packages\FrontPage\Shared\UseCase\LocaleSessionInterface;
class SetLocaleUseCase
{
private LocaleSessionInterface $localeSession;
public function __construct(LocaleSessionInterface $localeSession)
{
$this->localeSession = $localeSession;
}
/**
* locale変更
*
* @param string $localeParam
* @return void
*/
public function setLocale(string $localeParam)
{
$locale = new Locale($localeParam);
$this->localeSession->setLocaleSession($locale);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment