src/Entity/CompanyTag.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CompanyTagRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Gedmo\Mapping\Annotation as Gedmo;
  6. /**
  7.  * @ORM\Entity(repositoryClass=CompanyTagRepository::class)
  8.  */
  9. class CompanyTag
  10. {
  11.     /**
  12.      * @ORM\Id
  13.      * @ORM\GeneratedValue
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\ManyToOne(targetEntity=Tag::class, inversedBy="companyTags")
  19.      */
  20.     private $tag;
  21.     /**
  22.      * @ORM\ManyToOne(targetEntity=Company::class, inversedBy="companyTags")
  23.      */
  24.     private $company;
  25.     /**
  26.      * @ORM\Column(type="float")
  27.      */
  28.     private $coef;
  29.     /**
  30.      * @var float|null
  31.      * @ORM\Column(type="float", nullable=true)
  32.      */
  33.     private $visioCoef;
  34.     /**
  35.      * @ORM\Column(type="datetime")
  36.      * @Gedmo\Timestampable(on="create")
  37.      */
  38.     private $createdAt;
  39.     /**
  40.      * @ORM\Column(type="datetime")
  41.      * @Gedmo\Timestampable(on="update")
  42.      */
  43.     private $updatedAt;
  44.     public $isChecked false;
  45.     public function __construct()
  46.     {
  47.         $this->createdAt = new \DateTime();
  48.         $this->updatedAt = new \DateTime();
  49.         $this->coef 1;
  50.     }
  51.     public function getId(): ?int
  52.     {
  53.         return $this->id;
  54.     }
  55.     public function getTag(): ?Tag
  56.     {
  57.         return $this->tag;
  58.     }
  59.     public function setTag(?Tag $tag): self
  60.     {
  61.         $this->tag $tag;
  62.         return $this;
  63.     }
  64.     public function getCompany(): ?Company
  65.     {
  66.         return $this->company;
  67.     }
  68.     public function setCompany(?Company $company): self
  69.     {
  70.         $this->company $company;
  71.         return $this;
  72.     }
  73.     public function getCoef(): ?float
  74.     {
  75.         return $this->coef;
  76.     }
  77.     public function setCoef(?float $coef): self
  78.     {
  79.         // $coef = floatval(str_replace(",", ".", $coef));
  80.         $this->coef floatval($coef);
  81.         return $this;
  82.     }
  83.     public function getCreatedAt(): ?\DateTime
  84.     {
  85.         return $this->createdAt;
  86.     }
  87.     public function setCreatedAt(\DateTime $createdAt): self
  88.     {
  89.         $this->createdAt $createdAt;
  90.         return $this;
  91.     }
  92.     public function getUpdatedAt(): ?\DateTime
  93.     {
  94.         return $this->updatedAt;
  95.     }
  96.     public function setUpdatedAt(\DateTime $updatedAt): self
  97.     {
  98.         $this->updatedAt $updatedAt;
  99.         return $this;
  100.     }
  101.     /**
  102.      * @param float|null $visioCoef
  103.      * @return CompanyTag
  104.      */
  105.     public function setVisioCoef(?float $visioCoef): CompanyTag
  106.     {
  107.         $this->visioCoef $visioCoef;
  108.         return $this;
  109.     }
  110.     /**
  111.      * @return float|null
  112.      */
  113.     public function getVisioCoef(): ?float
  114.     {
  115.         return $this->visioCoef;
  116.     }
  117. }