CREATION BDD WORK !!!

main
Mathis MOULIN 2 weeks ago
parent 5deb30eefe
commit 57c6e07617

20
.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 ###

@ -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.*",

@ -0,0 +1,132 @@
<?php
namespace App\Entity;
use App\Repository\EmojiRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: EmojiRepository::class)]
class Emoji
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $nom = null;
#[ORM\Column(length: 255)]
private ?string $code = null;
#[ORM\Column]
private ?float $force = null;
#[ORM\Column]
private ?float $robustesse = null;
#[ORM\Column]
private ?float $intelligence = null;
#[ORM\Column]
private ?float $vitesse = null;
#[ORM\Column]
private ?int $nbCombatGagne = null;
#[ORM\Column]
private ?int $rarete = null;
public function getId(): ?int
{
return $this->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;
}
}

@ -0,0 +1,48 @@
<?php
namespace App\Repository;
use App\Entity\Emoji;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<Emoji>
*
* @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()
// ;
// }
}
Loading…
Cancel
Save