src/DataTransferObject/Messaging/UpdateWaterFlow.php line 9

Open in your IDE?
  1. <?php
  2. namespace App\DataTransferObject\Messaging;
  3. use App\DataTransferObject\DeliveryStationWaterFlow;
  4. use App\Validator\Constraints\MessageFile as AssertMessageFile;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. class UpdateWaterFlow implements \Serializable
  7. {
  8.     public const NO_VALUE '';
  9.     public const FARMING_VITICULTURE 'VITICULTURE';
  10.     public const FARMING_MIXED 'MIXED';
  11.     public const FARMING_ARBORICULTURE 'ARBORICULTURE';
  12.     public const FARMING_CEREALS 'CEREALS';
  13.     public const FARMING_VEGETAL 'VEGETAL';
  14.     public const FARMING_SERRISTE 'SERRISTE';
  15.     public const FARMING_OTHER 'OTHER';
  16.     /**
  17.      * @Assert\NotBlank(groups={"step_delivery_station"})
  18.      */
  19.     protected $deliveryStationWaterFlow;
  20.     /**
  21.      * @Assert\NotBlank(groups={"step_water_flow"})
  22.      * @Assert\Expression(
  23.      *     groups={"step_water_flow"},
  24.      *     expression="value !== this.getDeliveryStationWaterFlow().getWaterFlow()",
  25.      *     message="messaging.update_water_flow.index"
  26.      * )
  27.      */
  28.     protected $desiredFlow;
  29.     protected $unlock false;
  30.     protected $comment;
  31.     /**
  32.      * @Assert\Choice(choices={
  33.      *     UpdateWaterFlow::FARMING_VITICULTURE,
  34.      *     UpdateWaterFlow::FARMING_MIXED,
  35.      *     UpdateWaterFlow::FARMING_ARBORICULTURE,
  36.      *     UpdateWaterFlow::FARMING_CEREALS,
  37.      *     UpdateWaterFlow::FARMING_VEGETAL,
  38.      *     UpdateWaterFlow::FARMING_SERRISTE,
  39.      *     UpdateWaterFlow::FARMING_OTHER,
  40.      * }, groups={"step_delivery_station"})
  41.      */
  42.     protected $farmingType;
  43.     /**
  44.      * @Assert\All({
  45.      *     @AssertMessageFile
  46.      * })
  47.      */
  48.     protected $files = [];
  49.     public function getDeliveryStationWaterFlow(): ?DeliveryStationWaterFlow
  50.     {
  51.         return $this->deliveryStationWaterFlow;
  52.     }
  53.     public function setDeliveryStationWaterFlow(DeliveryStationWaterFlow $deliveryStationWaterFlow): self
  54.     {
  55.         $this->deliveryStationWaterFlow $deliveryStationWaterFlow;
  56.         return $this;
  57.     }
  58.     public function getDesiredFlow(): ?float
  59.     {
  60.         return $this->desiredFlow;
  61.     }
  62.     public function setDesiredFlow(?float $desiredFlow): self
  63.     {
  64.         $this->desiredFlow $desiredFlow;
  65.         return $this;
  66.     }
  67.     public function getFarmingType(): ?string
  68.     {
  69.         return $this->farmingType;
  70.     }
  71.     public function setFarmingType(string $farmingType): self
  72.     {
  73.         $this->farmingType $farmingType;
  74.         return $this;
  75.     }
  76.     public function isUnlock(): bool
  77.     {
  78.         return $this->unlock;
  79.     }
  80.     public function setUnlock(bool $unlock): self
  81.     {
  82.         $this->unlock $unlock;
  83.         return $this;
  84.     }
  85.     public function getComment(): ?string
  86.     {
  87.         return $this->comment;
  88.     }
  89.     public function setComment(?string $comment): self
  90.     {
  91.         $this->comment $comment;
  92.         return $this;
  93.     }
  94.     public function getFiles(): array
  95.     {
  96.         return $this->files;
  97.     }
  98.     public function setFiles(array $files): self
  99.     {
  100.         $this->files $files;
  101.         return $this;
  102.     }
  103.     public function serialize()
  104.     {
  105.         return serialize([
  106.             $this->deliveryStationWaterFlow,
  107.             $this->desiredFlow,
  108.             $this->farmingType,
  109.             $this->unlock,
  110.             $this->comment,
  111.         ]);
  112.     }
  113.     public function unserialize($serialized)
  114.     {
  115.         list($this->deliveryStationWaterFlow$this->desiredFlow$this->farmingType$this->unlock$this->comment) = unserialize($serialized);
  116.     }
  117. }