1: <?php
2:
3: namespace ProgrammingAreHard\Arbiter\Domain;
4:
5: use ProgrammingAreHard\Arbiter\Model\IdentityFactoryInterface;
6: use Symfony\Component\Security\Acl\Domain\ObjectIdentity;
7: use Symfony\Component\Security\Acl\Domain\UserSecurityIdentity;
8: use Symfony\Component\Security\Core\User\UserInterface;
9:
10: class IdentityFactory implements IdentityFactoryInterface
11: {
12: 13: 14:
15: public function getObjectIdentity($object)
16: {
17: return ObjectIdentity::fromDomainObject($object);
18: }
19:
20: 21: 22:
23: public function getUserIdentity(UserInterface $user)
24: {
25: return UserSecurityIdentity::fromAccount($user);
26: }
27: }