2021-11-30 13:54:58 +01:00

50 lines
1.2 KiB
PHP

<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\MainBundle\Security\Resolver;
use Chill\MainBundle\Entity\Scope;
/**
* Interface to implement to define a ScopeResolver.
*/
interface ScopeResolverInterface
{
/**
* get the default priority for this resolver. Resolver with an higher priority will be
* queried first.
*/
public static function getDefaultPriority(): int;
/**
* Return true if the entity is concerned by scope, false otherwise.
*
* @param mixed $entity
*/
public function isConcerned($entity, ?array $options = []): bool;
/**
* Will return the scope for the entity.
*
* @param mixed $entity
*
* @return array|Scope|Scope[]
*/
public function resolveScope($entity, ?array $options = []);
/**
* Return true if this resolve is able to decide "something" on this entity.
*
* @param mixed $entity
*/
public function supports($entity, ?array $options = []): bool;
}