feature: Add Printer Class

Add Printer Class
This commit is contained in:
Jan Klattenhoff 2024-01-17 15:06:46 +01:00
parent d81c3752b9
commit feca2cc5ca
25 changed files with 5267 additions and 5 deletions

0
src/Entity/.gitignore vendored Normal file
View file

80
src/Entity/Printer.php Normal file
View file

@ -0,0 +1,80 @@
<?php
namespace App\Entity;
use App\Repository\PrinterRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: PrinterRepository::class)]
class Printer
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $name = null;
#[ORM\Column]
private ?float $price = null;
#[ORM\Column(length: 255)]
private ?string $buildVolume = null;
#[ORM\Column]
private ?float $maxSpeed = null;
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): static
{
$this->name = $name;
return $this;
}
public function getPrice(): ?float
{
return $this->price;
}
public function setPrice(float $price): static
{
$this->price = $price;
return $this;
}
public function getBuildVolume(): ?string
{
return $this->buildVolume;
}
public function setBuildVolume(string $buildVolume): static
{
$this->buildVolume = $buildVolume;
return $this;
}
public function getMaxSpeed(): ?float
{
return $this->maxSpeed;
}
public function setMaxSpeed(float $maxSpeed): static
{
$this->maxSpeed = $maxSpeed;
return $this;
}
}

0
src/Repository/.gitignore vendored Normal file
View file

View file

@ -0,0 +1,48 @@
<?php
namespace App\Repository;
use App\Entity\Printer;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<Printer>
*
* @method Printer|null find($id, $lockMode = null, $lockVersion = null)
* @method Printer|null findOneBy(array $criteria, array $orderBy = null)
* @method Printer[] findAll()
* @method Printer[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class PrinterRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, Printer::class);
}
// /**
// * @return Printer[] Returns an array of Printer objects
// */
// public function findByExampleField($value): array
// {
// return $this->createQueryBuilder('p')
// ->andWhere('p.exampleField = :val')
// ->setParameter('val', $value)
// ->orderBy('p.id', 'ASC')
// ->setMaxResults(10)
// ->getQuery()
// ->getResult()
// ;
// }
// public function findOneBySomeField($value): ?Printer
// {
// return $this->createQueryBuilder('p')
// ->andWhere('p.exampleField = :val')
// ->setParameter('val', $value)
// ->getQuery()
// ->getOneOrNullResult()
// ;
// }
}