src/Flexy/ShopBundle/Entity/Order/RoomAccess.php line 13

  1. <?php
  2. namespace App\Flexy\ShopBundle\Entity\Order;
  3. use App\Flexy\ShopBundle\Repository\Order\OrderItemRepository;
  4. use App\Repository\Flexy\ShopBundle\Entity\Order\RoomAccessRepository;
  5.  
  6.  
  7. use Doctrine\DBAL\Types\Types;
  8. use Doctrine\ORM\Mapping as ORM;
  9. #[ORM\Entity(repositoryClassRoomAccessRepository::class)]
  10. class RoomAccess
  11. {
  12.     #[ORM\Id]
  13.     #[ORM\GeneratedValue]
  14.     #[ORM\Column]
  15.     private ?int $id null;
  16.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  17.     private ?\DateTimeInterface $time null;
  18.     #[ORM\Column(length255nullabletrue)]
  19.     private ?string $card null;
  20.     #[ORM\Column(length255nullabletrue)]
  21.     private ?string $door null;
  22.     public function getId(): ?int
  23.     {
  24.         return $this->id;
  25.     }
  26.     public function getTime(): ?\DateTimeInterface
  27.     {
  28.         return $this->time;
  29.     }
  30.     public function setTime(?\DateTimeInterface $time): static
  31.     {
  32.         $this->time $time;
  33.         return $this;
  34.     }
  35.     public function getCard(): ?string
  36.     {
  37.         return $this->card;
  38.     }
  39.     public function setCard(?string $card): static
  40.     {
  41.         $this->card $card;
  42.         return $this;
  43.     }
  44.     public function getDoor(): ?string
  45.     {
  46.         return $this->door;
  47.     }
  48.     public function setDoor(?string $door): static
  49.     {
  50.         $this->door $door;
  51.         return $this;
  52.     }
  53.     public function getProductName(?OrderItemRepository $repo null): string
  54.     {
  55.         if (!$repo) return '';
  56.         $id = (int)substr($this->card3);
  57.         $product $repo->findOneBy(['parentOrder' =>  $id]);
  58.         return $product $product->getDescription() : 'D';
  59.     }
  60. }