From 57c6e076171146066e6e3b80ee5546f04b4342ad Mon Sep 17 00:00:00 2001 From: "mathis.moulin" Date: Wed, 28 May 2025 13:31:56 +0200 Subject: [PATCH] CREATION BDD WORK !!! --- .env | 20 +---- composer.json | 2 +- src/Entity/Emoji.php | 132 +++++++++++++++++++++++++++++ src/Repository/EmojiRepository.php | 48 +++++++++++ 4 files changed, 182 insertions(+), 20 deletions(-) create mode 100644 src/Entity/Emoji.php create mode 100644 src/Repository/EmojiRepository.php diff --git a/.env b/.env index d23bcd2..325d3ec 100644 --- a/.env +++ b/.env @@ -18,23 +18,5 @@ APP_ENV=dev APP_SECRET=e10d1768cebd3187e908e91448a3086a ###< symfony/framework-bundle ### +MESSENGER_TRANSPORT_DSN=sync:// -###> doctrine/doctrine-bundle ### -# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url -# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml -# -# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data_%kernel.environment%.db" -# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=8&charset=utf8mb4" -DATABASE_URL="postgresql://app:!ChangeMe!@127.0.0.1:5432/app?serverVersion=16&charset=utf8" -###< doctrine/doctrine-bundle ### - -###> symfony/messenger ### -# Choose one of the transports below -# MESSENGER_TRANSPORT_DSN=amqp://guest:guest@localhost:5672/%2f/messages -# MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages -MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0 -###< symfony/messenger ### - -###> symfony/mailer ### -MAILER_DSN=null://null -###< symfony/mailer ### diff --git a/composer.json b/composer.json index fed2f35..ace294d 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "doctrine/doctrine-migrations-bundle": "^3.4", "doctrine/orm": "^3.3", "phpdocumentor/reflection-docblock": "^5.6", - "phpstan/phpdoc-parser": "^2.1", + "phpstan/phpdoc-parser": "1.26", "symfony/asset": "6.1.*", "symfony/console": "6.1.*", "symfony/doctrine-messenger": "6.1.*", diff --git a/src/Entity/Emoji.php b/src/Entity/Emoji.php new file mode 100644 index 0000000..1820873 --- /dev/null +++ b/src/Entity/Emoji.php @@ -0,0 +1,132 @@ +id; + } + + public function getNom(): ?string + { + return $this->nom; + } + + public function setNom(string $nom): self + { + $this->nom = $nom; + return $this; + } + + public function getCode(): ?string + { + return $this->code; + } + + public function setCode(string $code): self + { + $this->code = $code; + return $this; + } + + public function getForce(): ?float + { + return $this->force; + } + + public function setForce(float $force): self + { + $this->force = $force; + return $this; + } + + public function getRobustesse(): ?float + { + return $this->robustesse; + } + + public function setRobustesse(float $robustesse): self + { + $this->robustesse = $robustesse; + return $this; + } + + public function getIntelligence(): ?float + { + return $this->intelligence; + } + + public function setIntelligence(float $intelligence): self + { + $this->intelligence = $intelligence; + return $this; + } + + public function getVitesse(): ?float + { + return $this->vitesse; + } + + public function setVitesse(float $vitesse): self + { + $this->vitesse = $vitesse; + return $this; + } + + public function getNbCombatGagne(): ?int + { + return $this->nbCombatGagne; + } + + public function setNbCombatGagne(int $nbCombatGagne): self + { + $this->nbCombatGagne = $nbCombatGagne; + return $this; + } + + public function getRarete(): ?int + { + return $this->rarete; + } + + public function setRarete(int $rarete): self + { + $this->rarete = $rarete; + return $this; + } +} diff --git a/src/Repository/EmojiRepository.php b/src/Repository/EmojiRepository.php new file mode 100644 index 0000000..a193e49 --- /dev/null +++ b/src/Repository/EmojiRepository.php @@ -0,0 +1,48 @@ + + * + * @method Emoji|null find($id, $lockMode = null, $lockVersion = null) + * @method Emoji|null findOneBy(array $criteria, array $orderBy = null) + * @method Emoji[] findAll() + * @method Emoji[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + */ +class EmojiRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, Emoji::class); + } + +// /** +// * @return Emoji[] Returns an array of Emoji objects +// */ +// public function findByExampleField($value): array +// { +// return $this->createQueryBuilder('e') +// ->andWhere('e.exampleField = :val') +// ->setParameter('val', $value) +// ->orderBy('e.id', 'ASC') +// ->setMaxResults(10) +// ->getQuery() +// ->getResult() +// ; +// } + +// public function findOneBySomeField($value): ?Emoji +// { +// return $this->createQueryBuilder('e') +// ->andWhere('e.exampleField = :val') +// ->setParameter('val', $value) +// ->getQuery() +// ->getOneOrNullResult() +// ; +// } +}