/** * @param \Symfony\Component\Security\Acl\Model\ObjectIdentityInterface|\BackBee\Security\Acl\Domain\AbstractObjectIdentifiable $objectIdentity * @throws \InvalidArgumentException */ private function enforceObjectIdentity(&$objectIdentity) { if ($objectIdentity instanceof ObjectIdentifiableInterface) { $objectIdentity = new ObjectIdentity($objectIdentity->getObjectIdentifier(), get_class($objectIdentity)); } elseif (!$objectIdentity instanceof ObjectIdentityInterface) { throw new \InvalidArgumentException('Object must implement ObjectIdentifiableInterface'); } }