<?php
namespace App\Security\Voter\Permissions\User;
use App\Manager\ContractManagerInterface;
use App\Manager\UserManagerInterface;
class UserContractVoter extends UserVoter
{
protected ContractManagerInterface $contractManager;
public function __construct(ContractManagerInterface $contractManager, UserManagerInterface $userManager)
{
parent::__construct($userManager);
$this->contractManager = $contractManager;
}
protected function getEntities(string $userId)
{
list($contracts) = $this->contractManager->getContractsByUser($userId, 1, null);
return $contracts;
}
}