adapt UI and controller for Person without centers

This commit is contained in:
2021-09-03 12:41:41 +02:00
parent 2450655452
commit 5b70fb2ee5
14 changed files with 196 additions and 53 deletions

View File

@@ -0,0 +1,30 @@
<?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;
}
}