Skip to content
Snippets Groups Projects
Commit 2d1dd4cb authored by ROUILLON Tom's avatar ROUILLON Tom
Browse files

New entities

parent bad619c9
No related branches found
No related tags found
No related merge requests found
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class AdherentController extends AbstractController
{
#[Route('/adherent', name: 'app_adherent')]
public function index(): Response
{
return $this->render('adherent/index.html.twig', [
'controller_name' => 'AdherentController',
]);
}
}
<?php
namespace App\Entity;
use App\Repository\AdherentRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: AdherentRepository::class)]
class Adherent
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 100)]
private ?string $raisonSociale = null;
#[ORM\Column(length: 10)]
private ?string $civilite = null;
#[ORM\Column(length: 45, nullable: true)]
private ?string $nom = null;
#[ORM\Column(length: 45, nullable: true)]
private ?string $prenom = null;
#[ORM\Column(length: 100, nullable: true)]
private ?string $adresse = null;
#[ORM\Column(length: 10, nullable: true)]
private ?string $codePostal = null;
#[ORM\Column(length: 45, nullable: true)]
private ?string $ville = null;
#[ORM\Column(length: 20, nullable: true)]
private ?string $telephone = null;
#[ORM\Column(length: 20, nullable: true)]
private ?string $telephone2 = null;
#[ORM\Column(length: 20, nullable: true)]
private ?string $telephone3 = null;
#[ORM\Column(length: 45, nullable: true)]
private ?string $mail = null;
#[ORM\Column(length: 45, nullable: true)]
private ?string $profession = null;
#[ORM\Column(type: Types::DATE_MUTABLE, nullable: true)]
private ?\DateTimeInterface $dateNaissance = null;
#[ORM\Column(length: 200, nullable: true)]
private ?string $password = null;
#[ORM\Column(type: Types::DATE_MUTABLE, nullable: true)]
private ?\DateTimeInterface $datePremiereAdhesion = null;
#[ORM\Column(nullable: true)]
private ?bool $dispenseAdhesion = null;
#[ORM\Column(nullable: true)]
private ?bool $adhesionAJour = null;
public function getId(): ?int
{
return $this->id;
}
public function setId(int $id): static
{
$this->id = $id;
return $this;
}
public function getRaisonSociale(): ?string
{
return $this->raisonSociale;
}
public function setRaisonSociale(string $raisonSociale): static
{
$this->raisonSociale = $raisonSociale;
return $this;
}
public function getCivilite(): ?string
{
return $this->civilite;
}
public function setCivilite(string $civilite): static
{
$this->civilite = $civilite;
return $this;
}
public function getNom(): ?string
{
return $this->nom;
}
public function setNom(?string $nom): static
{
$this->nom = $nom;
return $this;
}
public function getPrenom(): ?string
{
return $this->prenom;
}
public function setPrenom(?string $prenom): static
{
$this->prenom = $prenom;
return $this;
}
public function getAdresse(): ?string
{
return $this->adresse;
}
public function setAdresse(?string $adresse): static
{
$this->adresse = $adresse;
return $this;
}
public function getCodePostal(): ?string
{
return $this->codePostal;
}
public function setCodePostal(?string $codePostal): static
{
$this->codePostal = $codePostal;
return $this;
}
public function getVille(): ?string
{
return $this->ville;
}
public function setVille(?string $ville): static
{
$this->ville = $ville;
return $this;
}
public function getTelephone(): ?string
{
return $this->telephone;
}
public function setTelephone(?string $telephone): static
{
$this->telephone = $telephone;
return $this;
}
public function getTelephone2(): ?string
{
return $this->telephone2;
}
public function setTelephone2(?string $telephone2): static
{
$this->telephone2 = $telephone2;
return $this;
}
public function getTelephone3(): ?string
{
return $this->telephone3;
}
public function setTelephone3(?string $telephone3): static
{
$this->telephone3 = $telephone3;
return $this;
}
public function getMail(): ?string
{
return $this->mail;
}
public function setMail(?string $mail): static
{
$this->mail = $mail;
return $this;
}
public function getProfession(): ?string
{
return $this->profession;
}
public function setProfession(?string $profession): static
{
$this->profession = $profession;
return $this;
}
public function getDateNaissance(): ?\DateTimeInterface
{
return $this->dateNaissance;
}
public function setDateNaissance(?\DateTimeInterface $dateNaissance): static
{
$this->dateNaissance = $dateNaissance;
return $this;
}
public function getPassword(): ?string
{
return $this->password;
}
public function setPassword(?string $password): static
{
$this->password = $password;
return $this;
}
public function getDatePremiereAdhesion(): ?\DateTimeInterface
{
return $this->datePremiereAdhesion;
}
public function setDatePremiereAdhesion(?\DateTimeInterface $datePremiereAdhesion): static
{
$this->datePremiereAdhesion = $datePremiereAdhesion;
return $this;
}
public function isDispenseAdhesion(): ?bool
{
return $this->dispenseAdhesion;
}
public function setDispenseAdhesion(?bool $dispenseAdhesion): static
{
$this->dispenseAdhesion = $dispenseAdhesion;
return $this;
}
public function isAdhesionAJour(): ?bool
{
return $this->adhesionAJour;
}
public function setAdhesionAJour(?bool $adhesionAJour): static
{
$this->adhesionAJour = $adhesionAJour;
return $this;
}
}
<?php
namespace App\Repository;
use App\Entity\Adherent;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<Adherent>
*
* @method Adherent|null find($id, $lockMode = null, $lockVersion = null)
* @method Adherent|null findOneBy(array $criteria, array $orderBy = null)
* @method Adherent[] findAll()
* @method Adherent[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class AdherentRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, Adherent::class);
}
// /**
// * @return Adherent[] Returns an array of Adherent objects
// */
// public function findByExampleField($value): array
// {
// return $this->createQueryBuilder('a')
// ->andWhere('a.exampleField = :val')
// ->setParameter('val', $value)
// ->orderBy('a.id', 'ASC')
// ->setMaxResults(10)
// ->getQuery()
// ->getResult()
// ;
// }
// public function findOneBySomeField($value): ?Adherent
// {
// return $this->createQueryBuilder('a')
// ->andWhere('a.exampleField = :val')
// ->setParameter('val', $value)
// ->getQuery()
// ->getOneOrNullResult()
// ;
// }
}
{% extends 'base.html.twig' %}
{% block title %}Hello AdherentController!{% endblock %}
{% block body %}
<style>
.example-wrapper { margin: 1em auto; max-width: 800px; width: 95%; font: 18px/1.5 sans-serif; }
.example-wrapper code { background: #F5F5F5; padding: 2px 6px; }
</style>
<div class="example-wrapper">
<h1>Hello {{ controller_name }}! ✅</h1>
This friendly message is coming from:
<ul>
<li>Your controller at <code><a href="{{ '/var/www/symfony_docker/src/Controller/AdherentController.php'|file_link(0) }}">src/Controller/AdherentController.php</a></code></li>
<li>Your template at <code><a href="{{ '/var/www/symfony_docker/templates/adherent/index.html.twig'|file_link(0) }}">templates/adherent/index.html.twig</a></code></li>
</ul>
</div>
{% endblock %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment