src/Identity/Service/IdentityService.php
public function generateIdentity(Identitiable $model, bool $overwrite = false)
    {
        if (null === $model->getIdentity() || $overwrite) {
            $user = $this->tokenStorage->getToken()->getUser();
            $model
                ->setIdentity($user->getIdentity()->getType())
                ->setIdentityUuid($user->getIdentity()->getUuid());
        }

        return $this;
    }
public function generateIdentity(Identitiable $model, bool $overwrite = false)
    {
        if (null === $model->getIdentity() || $overwrite) {
            $user = $this->tokenStorage->getToken()->getUser();
            $model
                ->setIdentity($user->getIdentity()->getType())
                ->setIdentityUuid($user->getIdentity()->getUuid());
        }

        return $this;
    }
Generate entity identity, if none present

@param \Ds\Component\Model\Type\Identitiable $model
@param boolean $overwrite
@return \Ds\Component\Identity\Service\IdentityService