LoginSignup
0
0

More than 5 years have passed since last update.

eZ Publish の Controller まわり

Posted at

特定ロケーションの viewCache の破棄

$this->container->get( 'ezpublish.http_cache.purger' )->purge( $locationId );

すべての viewCache の破棄

$this->container->get( 'ezpublish.http_cache.purger' )->purgeAll();

子のロケーション ID の取得

$currentLocation = $locationService->loadLocation( $locationId );
$currentLocationChildren = $locationService->loadLocationChildren(
    $currentLocation, $offset = 0, $limit = -1
);
$childrenLocatinoId = array();
foreach ( $currentLocationChildren->locations as $childLocation )
{
    $childrenLocatinoId[] = $childLocation->contentInfo->mainLocationId;
}

認証済みユーザーの確認

$securityToken = $this->container->get('security.context')->getToken();
$userAuth = $securityToken->isAuthenticated(); // return true or false

Symfony ロケールを eZ Publish に変換

$symfonyLocale = $this->getRequest()->get( '_locale' );
$localeConverter = $this->container->get( 'ezpublish.locale.converter' );
$ezLocale = $ezLocale = $localeConverter->convertToEz( $symfonyLocale );
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0