code: 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;
      }
docs: Generate entity identity, if none present
  
  @param \Ds\Component\Model\Type\Identitiable $model
  @param boolean $overwrite
  @return \Ds\Component\Identity\Service\IdentityService