<?php/** * @license SILK SOFTWARE HOUSE SP Z O O */namespace App\Entity;use App\Entity\Traits\UserPriorityTrait;use Doctrine\ORM\Mapping as ORM;use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;/** * @ORM\Entity(repositoryClass="App\Repository\RecipeToSyncRepository") * @ORM\Table( * name="recipe_to_sync", * uniqueConstraints={@ORM\UniqueConstraint(columns={"priority", "device_id", "recipe_id"})} * ) */class RecipeToSync{ use UserPriorityTrait; const DEFAULT_COUNT = 0; /** * @ORM\Id() * @ORM\GeneratedValue() * @ORM\Column(type="integer") */ private $id; /** * Date when synchronisation was scheduled * * @ORM\Column(type="datetime", nullable=true) */ private $scheduleDate; /** * @ORM\Column(type="integer", nullable=true) */ private $priority; /** * @ORM\ManyToOne(targetEntity="App\Entity\Recipe", inversedBy="recipeToSyncs") */ private $recipe; /** * @ORM\ManyToOne(targetEntity="App\Entity\Device", inversedBy="recipeToSyncs") */ private $device; public function getId(): ?int { return $this->id; } public function getScheduleDate(): ?\DateTimeInterface { return $this->scheduleDate; } public function setScheduleDate(?\DateTimeInterface $scheduleDate): self { $this->scheduleDate = $scheduleDate; return $this; } public function getPriority(): ?int { return $this->priority; } public function setPriority(?int $priority): self { $this->priority = $priority; return $this; } public function getRecipe(): ?Recipe { return $this->recipe; } public function setRecipe(?Recipe $recipe): self { $this->recipe = $recipe; return $this; } public function getDevice(): ?Device { return $this->device; } public function setDevice(?Device $device): self { $this->device = $device; return $this; }}