src/Repository/Event/InjectOrganizationReferenceListener.php
public function postLoad(LifecycleEventArgs $args)
    {
        $document = $args->getDocument();

        if ($document instanceof UserInterface) {
            $repository = $args->getDocumentManager()->getRepository('Organizations\Entity\Organization');
            $userId  = $document->getId();
            $reference = new OrganizationReference($userId, $repository);

            $document->setOrganization($reference);
        }
    }
public function postLoad(LifecycleEventArgs $args)
    {
        $document = $args->getDocument();

        if ($document instanceof UserInterface) {
            $repository = $args->getDocumentManager()->getRepository('Organizations\Entity\Organization');
            $userId  = $document->getId();
            $reference = new OrganizationReference($userId, $repository);

            $document->setOrganization($reference);
        }
    }
Creates and injects the organization reference to an user entity.

@param LifecycleEventArgs $args