src/Entity/Service/IdService.php
public function generateUuid(Uuidentifiable $entity, bool $overwrite = false)
    {
        if (null === $entity->getUuid() || $overwrite) {
            $uuid = Uuid::uuid4()->toString();
            $entity->setUuid($uuid);
        }

        return $this;
    }
public function generateUuid(Uuidentifiable $entity, bool $overwrite = false)
    {
        if (null === $entity->getUuid() || $overwrite) {
            $uuid = Uuid::uuid4()->toString();
            $entity->setUuid($uuid);
        }

        return $this;
    }
public function generateUuid ( Uuidentifiable $ entity , bool $ overwrite = false ) { if ( null === $ entity -> getUuid ( ) || $ overwrite ) { $ uuid = Uuid :: uuid4 ( ) -> toString ( ) ; $ entity -> setUuid ( $ uuid ) ; } return $ this ; }
Generate entity uuid, if none present

@param \Ds\Component\Model\Type\Uuidentifiable $entity
@param boolean $overwrite
@return \Ds\Component\Entity\Service\IdService
Generate entity uuid if none present