src/Entity/RecipeToSync.php line 19

Open in your IDE?
  1. <?php
  2. /**
  3.  * @license SILK SOFTWARE HOUSE SP Z O O
  4.  */
  5. namespace App\Entity;
  6. use App\Entity\Traits\UserPriorityTrait;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  9. /**
  10.  * @ORM\Entity(repositoryClass="App\Repository\RecipeToSyncRepository")
  11.  * @ORM\Table(
  12.  *     name="recipe_to_sync",
  13.  *     uniqueConstraints={@ORM\UniqueConstraint(columns={"priority", "device_id", "recipe_id"})}
  14.  * )
  15.  */
  16. class RecipeToSync
  17. {
  18.     use UserPriorityTrait;
  19.     const DEFAULT_COUNT 0;
  20.     /**
  21.      * @ORM\Id()
  22.      * @ORM\GeneratedValue()
  23.      * @ORM\Column(type="integer")
  24.      */
  25.     private $id;
  26.     /**
  27.      * Date when synchronisation was scheduled
  28.      *
  29.      * @ORM\Column(type="datetime", nullable=true)
  30.      */
  31.     private $scheduleDate;
  32.     /**
  33.      * @ORM\Column(type="integer", nullable=true)
  34.      */
  35.     private $priority;
  36.     /**
  37.      * @ORM\ManyToOne(targetEntity="App\Entity\Recipe", inversedBy="recipeToSyncs")
  38.      */
  39.     private $recipe;
  40.     /**
  41.      * @ORM\ManyToOne(targetEntity="App\Entity\Device", inversedBy="recipeToSyncs")
  42.      */
  43.     private $device;
  44.     public function getId(): ?int
  45.     {
  46.         return $this->id;
  47.     }
  48.     public function getScheduleDate(): ?\DateTimeInterface
  49.     {
  50.         return $this->scheduleDate;
  51.     }
  52.     public function setScheduleDate(?\DateTimeInterface $scheduleDate): self
  53.     {
  54.         $this->scheduleDate $scheduleDate;
  55.         return $this;
  56.     }
  57.     public function getPriority(): ?int
  58.     {
  59.         return $this->priority;
  60.     }
  61.     public function setPriority(?int $priority): self
  62.     {
  63.         $this->priority $priority;
  64.         return $this;
  65.     }
  66.     public function getRecipe(): ?Recipe
  67.     {
  68.         return $this->recipe;
  69.     }
  70.     public function setRecipe(?Recipe $recipe): self
  71.     {
  72.         $this->recipe $recipe;
  73.         return $this;
  74.     }
  75.     public function getDevice(): ?Device
  76.     {
  77.         return $this->device;
  78.     }
  79.     public function setDevice(?Device $device): self
  80.     {
  81.         $this->device $device;
  82.         return $this;
  83.     }
  84. }