<?php
namespace App\Entity\Declaration;
use ApiPlatform\Core\Annotation\ApiResource;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* @ORM\Entity(repositoryClass="App\Repository\Declaration\FieldRepository")
* @ORM\Table(name="brunex_declaration_field")
* @ApiResource(routePrefix="/brunex/declaration", attributes={"order"={"position": "ASC"}})
* @ORM\HasLifecycleCallbacks()
*/
class Field
{
const TYPE_TEXT = 'text';
const TYPE_SELECT = 'select';
const TYPE_FIXED = 'fixed';
const TYPE_CHECKBOX = 'checkbox';
/**
* @var int
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
* @Groups({"product", "declaration", "definition"})
*/
protected $id;
/**
* @var string
* @ORM\Column(type="text")
* @Groups({"product", "declaration", "definition"})
* @Gedmo\Translatable
*/
protected $name = '';
/**
* @var string
* @ORM\Column(type="text")
* @Groups({"product", "declaration", "definition"})
*/
protected $type = '';
/**
* @var bool
* @ORM\Column(type="boolean")
*/
protected $isSorted = false;
/**
* @var array
* @ORM\Column(type="array")
* @Groups({"product", "declaration", "definition"})
*/
protected $valueList = [];
/**
* @var int
* @ORM\Column(type="integer")
* @Groups({"product", "declaration", "definition"})
*/
protected $position = 9999;
/**
* @var bool
* @ORM\Column(type="boolean")
* @Groups({"product", "declaration", "definition"})
*/
protected $isRequired = false;
/**
* @var bool
* @ORM\Column(type="boolean")
* @Groups({"product", "declaration", "definition"})
*/
protected $isOptional = false;
/**
* @var bool
* @ORM\Column(type="boolean")
* @Groups({"product", "declaration", "definition"})
*/
protected $isHidden = false;
/**
* @var bool
* @ORM\Column(type="boolean")
* @Groups({"product", "declaration", "definition"})
*/
protected $exap = false;
/**
* @var string
* @ORM\Column(type="text")
* @Groups({"product", "declaration", "definition"})
*/
protected $notifiedBody = '';
/**
* @var string
* @ORM\Column(type="text")
* @Groups({"product", "declaration", "definition"})
*/
protected $variableName = '';
/**
* @var string
* @ORM\Column(type="text")
* @Groups({"product", "declaration", "definition"})
*/
protected $variablePrefix = '';
/**
* @var string
* @ORM\Column(type="text")
* @Groups({"product", "declaration", "definition"})
*/
protected $variableSuffix = '';
/**
* @var string
* @ORM\Column(type="text")
* @Groups({"product", "declaration", "definition"})
*/
protected $variableValue = '';
public function __toString()
{
return $this->name;
}
/**
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* @param string $name
*
* @return Field
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* @return string
*/
public function getType()
{
return $this->type;
}
/**
* @param string $type
*
* @return Field
*/
public function setType($type)
{
$this->type = $type;
return $this;
}
/**
* @return bool
*/
public function isSorted()
{
return $this->isSorted;
}
/**
* @param bool $isSorted
*
* @return Field
*/
public function setIsSorted($isSorted)
{
$this->isSorted = $isSorted;
return $this;
}
/**
* @return array
*/
public function getValueList()
{
return $this->valueList;
}
/**
* @param array $valueList
*
* @return Field
*/
public function setValueList(array $valueList)
{
$this->valueList = $valueList;
return $this;
}
/**
* @return int
*/
public function getPosition()
{
return $this->position;
}
/**
* @param int $position
*
* @return Field
*/
public function setPosition($position)
{
$this->position = $position;
return $this;
}
/**
* @return bool
*/
public function isRequired()
{
return $this->isRequired;
}
/**
* @param bool $isRequired
*
* @return Field
*/
public function setIsRequired($isRequired)
{
$this->isRequired = $isRequired;
return $this;
}
/**
* @return bool
*/
public function isOptional()
{
return $this->isOptional;
}
/**
* @param bool $isOptional
*
* @return Field
*/
public function setIsOptional($isOptional)
{
$this->isOptional = $isOptional;
return $this;
}
/**
* @return bool
*/
public function isHidden()
{
return $this->isHidden;
}
/**
* @param bool $isHidden
*
* @return Field
*/
public function setIsHidden($isHidden)
{
$this->isHidden = $isHidden;
return $this;
}
/**
* @return string
*/
public function getNotifiedBody()
{
return $this->notifiedBody;
}
/**
* @param string $notifiedBody
*
* @return Field
*/
public function setNotifiedBody($notifiedBody)
{
$this->notifiedBody = $notifiedBody;
return $this;
}
/**
* @return string
*/
public function getVariableName(): string
{
return $this->variableName;
}
/**
* @param string $variableName
*
* @return Field
*/
public function setVariableName(string $variableName): Field
{
$this->variableName = $variableName;
return $this;
}
/**
* @return bool
*/
public function isExap(): bool
{
return $this->exap;
}
/**
* @param bool $exap
*/
public function setExap(bool $exap): void
{
$this->exap = $exap;
}
/**
* @return string
*/
public function getVariableValue(): string
{
return $this->variableValue;
}
/**
* @param string $variableValue
*/
public function setVariableValue(string $variableValue): void
{
$this->variableValue = $variableValue;
}
/**
* @return string
*/
public function getVariablePrefix(): string
{
return $this->variablePrefix;
}
/**
* @param string $variablePrefix
*/
public function setVariablePrefix(string $variablePrefix): void
{
$this->variablePrefix = $variablePrefix;
}
/**
* @return string
*/
public function getVariableSuffix(): string
{
return $this->variableSuffix;
}
/**
* @param string $variableSuffix
*/
public function setVariableSuffix(string $variableSuffix): void
{
$this->variableSuffix = $variableSuffix;
}
}