Entity and Repository

This commit is contained in:
Maxiser 2024-10-10 15:59:26 +02:00
parent 27aeea65e4
commit 7f4e013d94
11 changed files with 623 additions and 0 deletions

35
src/Entity/Fault.php Normal file
View File

@ -0,0 +1,35 @@
<?php
namespace App\Entity;
use App\Repository\FaultRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: FaultRepository::class)]
class Fault
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $Wording = null;
public function getId(): ?int
{
return $this->id;
}
public function getWording(): ?string
{
return $this->Wording;
}
public function setWording(string $Wording): static
{
$this->Wording = $Wording;
return $this;
}
}

View File

@ -0,0 +1,96 @@
<?php
namespace App\Entity;
use App\Repository\InterventionRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: InterventionRepository::class)]
class Intervention
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $Wording = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE)]
private ?\DateTimeInterface $Timestamp = null;
#[ORM\Column(length: 255)]
private ?string $Description = null;
#[ORM\Column(length: 255)]
private ?string $Address = null;
#[ORM\Column(length: 255)]
private ?string $Status = null;
public function getId(): ?int
{
return $this->id;
}
public function getWording(): ?string
{
return $this->Wording;
}
public function setWording(string $Wording): static
{
$this->Wording = $Wording;
return $this;
}
public function getTimestamp(): ?\DateTimeInterface
{
return $this->Timestamp;
}
public function setTimestamp(\DateTimeInterface $Timestamp): static
{
$this->Timestamp = $Timestamp;
return $this;
}
public function getDescription(): ?string
{
return $this->Description;
}
public function setDescription(string $Description): static
{
$this->Description = $Description;
return $this;
}
public function getAddress(): ?string
{
return $this->Address;
}
public function setAddress(string $Address): static
{
$this->Address = $Address;
return $this;
}
public function getStatus(): ?string
{
return $this->Status;
}
public function setStatus(string $Status): static
{
$this->Status = $Status;
return $this;
}
}

50
src/Entity/Skill.php Normal file
View File

@ -0,0 +1,50 @@
<?php
namespace App\Entity;
use App\Repository\SkillRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: SkillRepository::class)]
class Skill
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $Wording = null;
#[ORM\Column(length: 255)]
private ?string $Description = null;
public function getId(): ?int
{
return $this->id;
}
public function getWording(): ?string
{
return $this->Wording;
}
public function setWording(string $Wording): static
{
$this->Wording = $Wording;
return $this;
}
public function getDescription(): ?string
{
return $this->Description;
}
public function setDescription(string $Description): static
{
$this->Description = $Description;
return $this;
}
}

65
src/Entity/Stock.php Normal file
View File

@ -0,0 +1,65 @@
<?php
namespace App\Entity;
use App\Repository\StockRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: StockRepository::class)]
class Stock
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $Wording = null;
#[ORM\Column(length: 255)]
private ?string $Description = null;
#[ORM\Column(length: 255)]
private ?string $Quantity = null;
public function getId(): ?int
{
return $this->id;
}
public function getWording(): ?string
{
return $this->Wording;
}
public function setWording(string $Wording): static
{
$this->Wording = $Wording;
return $this;
}
public function getDescription(): ?string
{
return $this->Description;
}
public function setDescription(string $Description): static
{
$this->Description = $Description;
return $this;
}
public function getQuantity(): ?string
{
return $this->Quantity;
}
public function setQuantity(string $Quantity): static
{
$this->Quantity = $Quantity;
return $this;
}
}

112
src/Entity/User.php Normal file
View File

@ -0,0 +1,112 @@
<?php
namespace App\Entity;
use App\Repository\UserRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: UserRepository::class)]
#[ORM\Table(name: '`user`')]
class User
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $FirstName = null;
#[ORM\Column(length: 255)]
private ?string $LastName = null;
#[ORM\Column(type: Types::DATE_MUTABLE)]
private ?\DateTimeInterface $BirthDate = null;
#[ORM\Column(length: 255)]
private ?string $Email = null;
#[ORM\Column(length: 255)]
private ?string $Phone = null;
#[ORM\Column(length: 255)]
private ?string $Type = null;
public function getId(): ?int
{
return $this->id;
}
public function getFirstName(): ?string
{
return $this->FirstName;
}
public function setFirstName(string $FirstName): static
{
$this->FirstName = $FirstName;
return $this;
}
public function getLastName(): ?string
{
return $this->LastName;
}
public function setLastName(string $LastName): static
{
$this->LastName = $LastName;
return $this;
}
public function getBirthDate(): ?\DateTimeInterface
{
return $this->BirthDate;
}
public function setBirthDate(\DateTimeInterface $BirthDate): static
{
$this->BirthDate = $BirthDate;
return $this;
}
public function getEmail(): ?string
{
return $this->Email;
}
public function setEmail(string $Email): static
{
$this->Email = $Email;
return $this;
}
public function getPhone(): ?string
{
return $this->Phone;
}
public function setPhone(string $Phone): static
{
$this->Phone = $Phone;
return $this;
}
public function getType(): ?string
{
return $this->Type;
}
public function setType(string $Type): static
{
$this->Type = $Type;
return $this;
}
}

50
src/Entity/Vehicle.php Normal file
View File

@ -0,0 +1,50 @@
<?php
namespace App\Entity;
use App\Repository\VehicleRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: VehicleRepository::class)]
class Vehicle
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $LicensePlate = null;
#[ORM\Column(length: 255)]
private ?string $Brand = null;
public function getId(): ?int
{
return $this->id;
}
public function getLicensePlate(): ?string
{
return $this->LicensePlate;
}
public function setLicensePlate(string $LicensePlate): static
{
$this->LicensePlate = $LicensePlate;
return $this;
}
public function getBrand(): ?string
{
return $this->Brand;
}
public function setBrand(string $Brand): static
{
$this->Brand = $Brand;
return $this;
}
}

View File

@ -0,0 +1,43 @@
<?php
namespace App\Repository;
use App\Entity\Fault;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<Fault>
*/
class FaultRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, Fault::class);
}
// /**
// * @return Fault[] Returns an array of Fault objects
// */
// public function findByExampleField($value): array
// {
// return $this->createQueryBuilder('f')
// ->andWhere('f.exampleField = :val')
// ->setParameter('val', $value)
// ->orderBy('f.id', 'ASC')
// ->setMaxResults(10)
// ->getQuery()
// ->getResult()
// ;
// }
// public function findOneBySomeField($value): ?Fault
// {
// return $this->createQueryBuilder('f')
// ->andWhere('f.exampleField = :val')
// ->setParameter('val', $value)
// ->getQuery()
// ->getOneOrNullResult()
// ;
// }
}

View File

@ -0,0 +1,43 @@
<?php
namespace App\Repository;
use App\Entity\Intervention;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<Intervention>
*/
class InterventionRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, Intervention::class);
}
// /**
// * @return Intervention[] Returns an array of Intervention objects
// */
// public function findByExampleField($value): array
// {
// return $this->createQueryBuilder('i')
// ->andWhere('i.exampleField = :val')
// ->setParameter('val', $value)
// ->orderBy('i.id', 'ASC')
// ->setMaxResults(10)
// ->getQuery()
// ->getResult()
// ;
// }
// public function findOneBySomeField($value): ?Intervention
// {
// return $this->createQueryBuilder('i')
// ->andWhere('i.exampleField = :val')
// ->setParameter('val', $value)
// ->getQuery()
// ->getOneOrNullResult()
// ;
// }
}

View File

@ -0,0 +1,43 @@
<?php
namespace App\Repository;
use App\Entity\Skill;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<Skill>
*/
class SkillRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, Skill::class);
}
// /**
// * @return Skill[] Returns an array of Skill objects
// */
// public function findByExampleField($value): array
// {
// return $this->createQueryBuilder('s')
// ->andWhere('s.exampleField = :val')
// ->setParameter('val', $value)
// ->orderBy('s.id', 'ASC')
// ->setMaxResults(10)
// ->getQuery()
// ->getResult()
// ;
// }
// public function findOneBySomeField($value): ?Skill
// {
// return $this->createQueryBuilder('s')
// ->andWhere('s.exampleField = :val')
// ->setParameter('val', $value)
// ->getQuery()
// ->getOneOrNullResult()
// ;
// }
}

View File

@ -0,0 +1,43 @@
<?php
namespace App\Repository;
use App\Entity\Stock;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<Stock>
*/
class StockRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, Stock::class);
}
// /**
// * @return Stock[] Returns an array of Stock objects
// */
// public function findByExampleField($value): array
// {
// return $this->createQueryBuilder('s')
// ->andWhere('s.exampleField = :val')
// ->setParameter('val', $value)
// ->orderBy('s.id', 'ASC')
// ->setMaxResults(10)
// ->getQuery()
// ->getResult()
// ;
// }
// public function findOneBySomeField($value): ?Stock
// {
// return $this->createQueryBuilder('s')
// ->andWhere('s.exampleField = :val')
// ->setParameter('val', $value)
// ->getQuery()
// ->getOneOrNullResult()
// ;
// }
}

View File

@ -0,0 +1,43 @@
<?php
namespace App\Repository;
use App\Entity\Vehicle;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<Vehicle>
*/
class VehicleRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, Vehicle::class);
}
// /**
// * @return Vehicle[] Returns an array of Vehicle objects
// */
// public function findByExampleField($value): array
// {
// return $this->createQueryBuilder('v')
// ->andWhere('v.exampleField = :val')
// ->setParameter('val', $value)
// ->orderBy('v.id', 'ASC')
// ->setMaxResults(10)
// ->getQuery()
// ->getResult()
// ;
// }
// public function findOneBySomeField($value): ?Vehicle
// {
// return $this->createQueryBuilder('v')
// ->andWhere('v.exampleField = :val')
// ->setParameter('val', $value)
// ->getQuery()
// ->getOneOrNullResult()
// ;
// }
}