src/Entity/MyBooster/MyBoosterPanierSolution.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity\MyBooster;
  3. use App\Repository\MyBooster\MyBoosterPanierSolutionRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Doctrine\ORM\Mapping\JoinColumn;
  6. use Doctrine\ORM\Mapping\ManyToOne;
  7. use Exception;
  8. #[ORM\Entity(repositoryClassMyBoosterPanierSolutionRepository::class)]
  9. class MyBoosterPanierSolution implements \Serializable\Stringable
  10. {
  11.     #[ORM\Column(name'id'type'integer')]
  12.     #[ORM\Id]
  13.     #[ORM\GeneratedValue(strategy'AUTO')]
  14.     private ?int $id null;
  15.     #[ORM\ManyToOne(targetEntity\App\Entity\MyBooster\MyBoosterPanier::class, inversedBy'solutions')]
  16.     private $panier;
  17.     #[ORM\Column(name'active'type'boolean')]
  18.     private ?bool $active null;
  19.     #[ORM\Column(name'date'type'datetime')]
  20.     private \DateTime $date;
  21.     #[ORM\Column(name'version'type'integer')]
  22.     private ?int $version null;
  23.     #[ORM\Column(name'road'type'array')]
  24.     private ?array $road null;
  25.     #[ManyToOne(targetEntity\App\Entity\MyBooster\MyBoosterSolution::class)]
  26.     #[JoinColumn(name'solution'referencedColumnName'id')]
  27.     private $solution;
  28.     public function __construct()
  29.     {
  30.         $this->date = new \DateTime;
  31.     }
  32.     /**
  33.      * Get id.
  34.      *
  35.      * @return int
  36.      */
  37.     public function getId()
  38.     {
  39.         return $this->id;
  40.     }
  41.     /**
  42.      * Set active.
  43.      *
  44.      * @param bool $active
  45.      *
  46.      * @return MyBoosterPanierSolution
  47.      */
  48.     public function setActive($active)
  49.     {
  50.         $this->active $active;
  51.         return $this;
  52.     }
  53.     /**
  54.      * Get active.
  55.      *
  56.      * @return bool
  57.      */
  58.     public function getActive()
  59.     {
  60.         return $this->active;
  61.     }
  62.     /**
  63.      * Set date.
  64.      *
  65.      * @param \DateTime $date
  66.      *
  67.      * @return MyBoosterPanierSolution
  68.      */
  69.     public function setDate($date)
  70.     {
  71.         $this->date $date;
  72.         return $this;
  73.     }
  74.     /**
  75.      * Get date.
  76.      *
  77.      * @return \DateTime
  78.      */
  79.     public function getDate()
  80.     {
  81.         return $this->date;
  82.     }
  83.     /**
  84.      * Set version.
  85.      *
  86.      * @param int $version
  87.      *
  88.      * @return MyBoosterPanierSolution
  89.      */
  90.     public function setVersion($version)
  91.     {
  92.         $this->version $version;
  93.         return $this;
  94.     }
  95.     /**
  96.      * Get version.
  97.      *
  98.      * @return int
  99.      */
  100.     public function getVersion()
  101.     {
  102.         return $this->version;
  103.     }
  104.     /**
  105.      * Set road.
  106.      *
  107.      * @param array $road
  108.      *
  109.      * @return MyBoosterPanierSolution
  110.      */
  111.     public function setRoad($road)
  112.     {
  113.         $this->road $road;
  114.         return $this;
  115.     }
  116.     /**
  117.      * Get road.
  118.      *
  119.      * @return array
  120.      */
  121.     public function getRoad()
  122.     {
  123.         return $this->road;
  124.     }
  125.     /**
  126.      * @return mixed
  127.      */
  128.     public function getPanier()
  129.     {
  130.         return $this->panier;
  131.     }
  132.     public function setPanier(mixed $panier): void
  133.     {
  134.         $this->panier $panier;
  135.     }
  136.     /**
  137.      * @return mixed
  138.      */
  139.     public function getSolution()
  140.     {
  141.         return $this->solution;
  142.     }
  143.     public function setSolution(mixed $solution): void
  144.     {
  145.         $this->solution $solution;
  146.     }
  147.     /**
  148.      * @return string
  149.      */
  150.     public function __toString(): string{
  151.         return $this->solution->getNom();
  152.     }
  153.     public function serialize()
  154.     {
  155.         // TODO: Implement serialize() method.
  156.     }
  157.     public function unserialize($serialized)
  158.     {
  159.         [$this->road, ] = unserialize($serialized);
  160.     }
  161. }