mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
31 lines
652 B
PHP
31 lines
652 B
PHP
<?php
|
|
|
|
namespace Chill\MainBundle\Security\Resolver;
|
|
|
|
use Chill\MainBundle\Entity\Center;
|
|
use Chill\MainBundle\Entity\HasCenterInterface;
|
|
|
|
class DefaultCenterResolver implements CenterResolverInterface
|
|
{
|
|
public function supports($entity, ?array $options = []): bool
|
|
{
|
|
return $entity instanceof HasCenterInterface;
|
|
}
|
|
|
|
/**
|
|
* @inheritDoc
|
|
*
|
|
* @param HasCenterInterface $entity
|
|
* @param array $options
|
|
*/
|
|
public function resolveCenter($entity, ?array $options = [])
|
|
{
|
|
return $entity->getCenter();
|
|
}
|
|
|
|
public static function getDefaultPriority(): int
|
|
{
|
|
return -256;
|
|
}
|
|
}
|