initial commit

This commit is contained in:
boris
2025-09-30 09:24:25 +01:00
committed by boris
parent a783a12c97
commit c7770ea03b
4695 changed files with 525784 additions and 0 deletions

View File

@@ -0,0 +1,56 @@
<?php
use Symfony\Bundle\MakerBundle\Maker\Common\EntityIdTypeEnum;
?>
<?= "<?php\n" ?>
namespace <?= $namespace ?>;
<?= $use_statements; ?>
#[ORM\Entity(repositoryClass: <?= $repository_class_name ?>::class)]
<?php if ($should_escape_table_name): ?>#[ORM\Table(name: '`<?= $table_name ?>`')]
<?php endif ?>
<?php if ($api_resource): ?>
#[ApiResource]
<?php endif ?>
<?php if ($broadcast): ?>
#[Broadcast]
<?php endif ?>
class <?= $class_name."\n" ?>
{
<?php if (EntityIdTypeEnum::UUID === $id_type): ?>
#[ORM\Id]
#[ORM\Column(type: UuidType::NAME, unique: true)]
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
#[ORM\CustomIdGenerator(class: 'doctrine.uuid_generator')]
private ?Uuid $id = null;
public function getId(): ?Uuid
{
return $this->id;
}
<?php elseif (EntityIdTypeEnum::ULID === $id_type): ?>
#[ORM\Id]
#[ORM\Column(type: UlidType::NAME, unique: true)]
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
#[ORM\CustomIdGenerator(class: 'doctrine.ulid_generator')]
private ?Ulid $id = null;
public function getId(): ?Ulid
{
return $this->id;
}
<?php else: ?>
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
public function getId(): ?int
{
return $this->id;
}
<?php endif ?>
}

View File

@@ -0,0 +1,16 @@
<?= "<?php\n" ?>
namespace <?= $namespace; ?>;
<?= $use_statements; ?>
class <?= $class_name ?> extends Fixture
{
public function load(ObjectManager $manager): void
{
// $product = new Product();
// $manager->persist($product);
$manager->flush();
}
}

View File

@@ -0,0 +1,61 @@
<?= "<?php\n"; ?>
namespace <?= $namespace; ?>;
<?= $use_statements; ?>
/**
* @extends ServiceEntityRepository<<?= $entity_class_name; ?>>
*/
class <?= $class_name; ?> extends ServiceEntityRepository<?= $with_password_upgrade ? " implements PasswordUpgraderInterface\n" : "\n" ?>
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, <?= $entity_class_name; ?>::class);
}
<?php if ($include_example_comments): // When adding a new method without existing default comments, the blank line is automatically added.?>
<?php endif; ?>
<?php if ($with_password_upgrade): ?>
/**
* Used to upgrade (rehash) the user's password automatically over time.
*/
public function upgradePassword(<?= sprintf('%s ', $password_upgrade_user_interface->getShortName()); ?>$user, string $newHashedPassword): void
{
if (!$user instanceof <?= $entity_class_name ?>) {
throw new UnsupportedUserException(sprintf('Instances of "%s" are not supported.', $user::class));
}
$user->setPassword($newHashedPassword);
$this->getEntityManager()->persist($user);
$this->getEntityManager()->flush();
}
<?php endif ?>
<?php if ($include_example_comments): ?>
// /**
// * @return <?= $entity_class_name ?>[] Returns an array of <?= $entity_class_name ?> objects
// */
// public function findByExampleField($value): array
// {
// return $this->createQueryBuilder('<?= $entity_alias; ?>')
// ->andWhere('<?= $entity_alias; ?>.exampleField = :val')
// ->setParameter('val', $value)
// ->orderBy('<?= $entity_alias; ?>.id', 'ASC')
// ->setMaxResults(10)
// ->getQuery()
// ->getResult()
// ;
// }
// public function findOneBySomeField($value): ?<?= $entity_class_name."\n" ?>
// {
// return $this->createQueryBuilder('<?= $entity_alias ?>')
// ->andWhere('<?= $entity_alias ?>.exampleField = :val')
// ->setParameter('val', $value)
// ->getQuery()
// ->getOneOrNullResult()
// ;
// }
<?php endif; ?>
}

View File

@@ -0,0 +1,22 @@
{# Learn how to use Turbo Streams: https://github.com/symfony/ux-turbo#broadcast-doctrine-entities-update #}
{% block create %}
<turbo-stream action="append" target="<?= $class_name_plural ?>">
<template>
<div id="{{ '<?= $class_name ?>_' ~ id }}">
#{{ id }} created
</div>
</template>
</turbo-stream>
{% endblock %}
{% block update %}
<turbo-stream action="update" target="<?= $class_name ?>_{{ id }}">
<template>
#{{ id }} updated
</template>
</turbo-stream>
{% endblock %}
{% block remove %}
<turbo-stream action="remove" target="<?= $class_name ?>_{{ id }}"></turbo-stream>
{% endblock %}