src/Entity/Company/Param.php line 20

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Company;
  3. use ApiPlatform\Core\Annotation\ApiResource;
  4. use App\Repository\Company\ParamRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  7. /**
  8.  * @ORM\Table(
  9.  *      uniqueConstraints={@ORM\UniqueConstraint(columns={"code","company_id"})}
  10.  * )
  11.  * @ORM\Entity(repositoryClass=ParamRepository::class)
  12.  * @UniqueEntity(
  13.  *      fields={"code","company"},
  14.  *      message="credentials.duplicate.entry.provider-company"
  15.  * )
  16.  */
  17. class Param
  18. {
  19.     /**
  20.      * @ORM\Id
  21.      * @ORM\GeneratedValue
  22.      * @ORM\Column(type="integer")
  23.      */
  24.     private $id;
  25.     /**
  26.      * @ORM\ManyToOne(targetEntity=Company::class, inversedBy="params")
  27.      * @ORM\JoinColumn(nullable=false)
  28.      */
  29.     private $company;
  30.     /**
  31.      * @ORM\Column(type="string", length=50)
  32.      */
  33.     private $name;
  34.     /**
  35.      * @ORM\Column(type="string", length=255, nullable=true)
  36.      */
  37.     private $description;
  38.     /**
  39.      * @ORM\Column(type="string", length=50)
  40.      */
  41.     private $code;
  42.     /**
  43.      * @ORM\Column(type="string", length=50)
  44.      */
  45.     private $value;
  46.     public function getId(): ?int
  47.     {
  48.         return $this->id;
  49.     }
  50.     public function getCompany(): ?Company
  51.     {
  52.         return $this->company;
  53.     }
  54.     public function setCompany(?Company $company): self
  55.     {
  56.         $this->company $company;
  57.         return $this;
  58.     }
  59.     public function getName(): ?string
  60.     {
  61.         return $this->name;
  62.     }
  63.     public function setName(string $name): self
  64.     {
  65.         $this->name $name;
  66.         return $this;
  67.     }
  68.     public function getDescription(): ?string
  69.     {
  70.         return $this->description;
  71.     }
  72.     public function setDescription(?string $description): self
  73.     {
  74.         $this->description $description;
  75.         return $this;
  76.     }
  77.     public function getCode(): ?string
  78.     {
  79.         return $this->code;
  80.     }
  81.     public function setCode(string $code): self
  82.     {
  83.         $this->code $code;
  84.         return $this;
  85.     }
  86.     public function getValue(): ?string
  87.     {
  88.         return $this->value;
  89.     }
  90.     public function setValue(string $value): self
  91.     {
  92.         $this->value $value;
  93.         return $this;
  94.     }
  95. }