src/Entity/AntiTag.php line 6

Open in your IDE?
  1. <?php
  2. namespace Slivki\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. class AntiTag extends Entity implements \JsonSerializable{
  5.     protected $tag;
  6.     protected $offers;
  7.     public function __construct() {
  8.         $this->offers = new ArrayCollection();
  9.         }
  10.     public function getTag() {
  11.         return $this->tag;
  12.     }
  13.     public function setTag($tag) {
  14.         $this->tag $tag;
  15.     }
  16.     /**
  17.      * @return ArrayCollection
  18.      */
  19.     public function getOffers() {
  20.         return $this->offers;
  21.     }
  22.     public function addOffer(Offer $offer) {
  23.         if (!$this->offers->contains($offer)) {
  24.             $this->offers->add($offer);
  25.         }
  26.     }
  27.     public function jsonSerialize(): array
  28.     {
  29.         return [
  30.             'ID' => $this->ID,
  31.             'tag' => $this->tag
  32.         ];
  33.     }
  34. }