<?php
namespace App\DataTransferObject\Messaging;
use App\DataTransferObject\DeliveryStationWaterFlow;
use App\Validator\Constraints\MessageFile as AssertMessageFile;
use Symfony\Component\Validator\Constraints as Assert;
class UpdateWaterFlow implements \Serializable
{
public const NO_VALUE = '';
public const FARMING_VITICULTURE = 'VITICULTURE';
public const FARMING_MIXED = 'MIXED';
public const FARMING_ARBORICULTURE = 'ARBORICULTURE';
public const FARMING_CEREALS = 'CEREALS';
public const FARMING_VEGETAL = 'VEGETAL';
public const FARMING_SERRISTE = 'SERRISTE';
public const FARMING_OTHER = 'OTHER';
/**
* @Assert\NotBlank(groups={"step_delivery_station"})
*/
protected $deliveryStationWaterFlow;
/**
* @Assert\NotBlank(groups={"step_water_flow"})
* @Assert\Expression(
* groups={"step_water_flow"},
* expression="value !== this.getDeliveryStationWaterFlow().getWaterFlow()",
* message="messaging.update_water_flow.index"
* )
*/
protected $desiredFlow;
protected $unlock = false;
protected $comment;
/**
* @Assert\Choice(choices={
* UpdateWaterFlow::FARMING_VITICULTURE,
* UpdateWaterFlow::FARMING_MIXED,
* UpdateWaterFlow::FARMING_ARBORICULTURE,
* UpdateWaterFlow::FARMING_CEREALS,
* UpdateWaterFlow::FARMING_VEGETAL,
* UpdateWaterFlow::FARMING_SERRISTE,
* UpdateWaterFlow::FARMING_OTHER,
* }, groups={"step_delivery_station"})
*/
protected $farmingType;
/**
* @Assert\All({
* @AssertMessageFile
* })
*/
protected $files = [];
public function getDeliveryStationWaterFlow(): ?DeliveryStationWaterFlow
{
return $this->deliveryStationWaterFlow;
}
public function setDeliveryStationWaterFlow(DeliveryStationWaterFlow $deliveryStationWaterFlow): self
{
$this->deliveryStationWaterFlow = $deliveryStationWaterFlow;
return $this;
}
public function getDesiredFlow(): ?float
{
return $this->desiredFlow;
}
public function setDesiredFlow(?float $desiredFlow): self
{
$this->desiredFlow = $desiredFlow;
return $this;
}
public function getFarmingType(): ?string
{
return $this->farmingType;
}
public function setFarmingType(string $farmingType): self
{
$this->farmingType = $farmingType;
return $this;
}
public function isUnlock(): bool
{
return $this->unlock;
}
public function setUnlock(bool $unlock): self
{
$this->unlock = $unlock;
return $this;
}
public function getComment(): ?string
{
return $this->comment;
}
public function setComment(?string $comment): self
{
$this->comment = $comment;
return $this;
}
public function getFiles(): array
{
return $this->files;
}
public function setFiles(array $files): self
{
$this->files = $files;
return $this;
}
public function serialize()
{
return serialize([
$this->deliveryStationWaterFlow,
$this->desiredFlow,
$this->farmingType,
$this->unlock,
$this->comment,
]);
}
public function unserialize($serialized)
{
list($this->deliveryStationWaterFlow, $this->desiredFlow, $this->farmingType, $this->unlock, $this->comment) = unserialize($serialized);
}
}