src/Entity/Gos/SalesManagoEventType.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Gedmo\Mapping\Annotation as Gedmo;
  7. /**
  8.  * EventType
  9.  *
  10.  * @ORM\Table(name="salesmanago_event_type")
  11.  * @ORM\Entity(repositoryClass="App\Repository\SalesManagoEventTypeRepository")
  12.  * @ORM\HasLifecycleCallbacks
  13.  */
  14. class SalesManagoEventType
  15. {
  16.     public const CONTACT 'contact';
  17.     public const PURCHASE 'purchase';
  18.     public const CART 'cart';
  19.     public const TRANSACTION 'transaction';
  20.     public const CLIENT_HISTORY 'client-history';
  21.     public const OFFER 'offer';
  22.     public const LOGIN 'login';
  23.     public const CANCELLATION 'cancellation';
  24.     public const DOWNLOAD 'download';
  25.     public const CANCELLED 'cancelled';
  26.     public const RETURN = 'return';
  27.     public const APP_TYPE_RETENTION 'app-type-retention';
  28.     public const PENDING 'pending';
  29.     public const OTHER 'other';
  30.     public const RESERVATION 'reservation';
  31.     /**
  32.      * @var int
  33.      *
  34.      * @ORM\Column(name="id", type="integer")
  35.      * @ORM\Id
  36.      * @ORM\GeneratedValue(strategy="AUTO")
  37.      */
  38.     private $id;
  39.     /**
  40.      * @var string
  41.      *
  42.      * @ORM\Column(name="name", type="string", length=255)
  43.      */
  44.     private $name;
  45.     /**
  46.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\SalesManagoEvent", mappedBy="eventType")
  47.      */
  48.     private $event;
  49.     /**
  50.      * @Gedmo\Slug(fields={"name"})
  51.      * @ORM\Column(unique=true)
  52.      */
  53.     private $slug;
  54.     /**
  55.      * @ORM\Column(type="boolean", nullable=true)
  56.      */
  57.     private $isActive;
  58.     /**
  59.      * @ORM\Column(type="datetime")
  60.      */
  61.     private $createdAt;
  62.     /**
  63.      * @ORM\Column(type="datetime", nullable=true)
  64.      */
  65.     private $updatedAt;
  66.     /** @ORM\PrePersist() */
  67.     public function prePersist()
  68.     {
  69.         $this->createdAt = new \DateTime();
  70.     }
  71.     /** @ORM\PreUpdate() */
  72.     public function preUpdate()
  73.     {
  74.         $this->updatedAt = new \DateTime();
  75.     }
  76.     public function __toString()
  77.     {
  78.         return (string)$this->name;
  79.     }
  80.     /**
  81.      * Get id
  82.      *
  83.      * @return int
  84.      */
  85.     public function getId()
  86.     {
  87.         return $this->id;
  88.     }
  89.     /**
  90.      * Set name
  91.      *
  92.      * @param string $name
  93.      *
  94.      * @return SalesManagoEventType
  95.      */
  96.     public function setName($name)
  97.     {
  98.         $this->name $name;
  99.         return $this;
  100.     }
  101.     /**
  102.      * Get name
  103.      *
  104.      * @return string
  105.      */
  106.     public function getName()
  107.     {
  108.         return $this->name;
  109.     }
  110.     /**
  111.      * Set slug
  112.      *
  113.      * @param string $slug
  114.      *
  115.      * @return SalesManagoEventType
  116.      */
  117.     public function setSlug($slug)
  118.     {
  119.         $this->slug $slug;
  120.         return $this;
  121.     }
  122.     /**
  123.      * Get slug
  124.      *
  125.      * @return string
  126.      */
  127.     public function getSlug()
  128.     {
  129.         return $this->slug;
  130.     }
  131.     /**
  132.      * Set createdAt
  133.      *
  134.      * @param \DateTime $createdAt
  135.      *
  136.      * @return SalesManagoEventType
  137.      */
  138.     public function setCreatedAt($createdAt)
  139.     {
  140.         $this->createdAt $createdAt;
  141.         return $this;
  142.     }
  143.     /**
  144.      * Get createdAt
  145.      *
  146.      * @return \DateTime
  147.      */
  148.     public function getCreatedAt()
  149.     {
  150.         return $this->createdAt;
  151.     }
  152.     /**
  153.      * Set updatedAt
  154.      *
  155.      * @param \DateTime $updatedAt
  156.      *
  157.      * @return SalesManagoEventType
  158.      */
  159.     public function setUpdatedAt($updatedAt)
  160.     {
  161.         $this->updatedAt $updatedAt;
  162.         return $this;
  163.     }
  164.     /**
  165.      * Get updatedAt
  166.      *
  167.      * @return \DateTime
  168.      */
  169.     public function getUpdatedAt()
  170.     {
  171.         return $this->updatedAt;
  172.     }
  173.     /**
  174.      * Set isActive
  175.      *
  176.      * @param boolean $isActive
  177.      *
  178.      * @return SalesManagoEventType
  179.      */
  180.     public function setIsActive($isActive)
  181.     {
  182.         $this->isActive $isActive;
  183.         return $this;
  184.     }
  185.     /**
  186.      * Get isActive
  187.      *
  188.      * @return boolean
  189.      */
  190.     public function getIsActive()
  191.     {
  192.         return $this->isActive;
  193.     }
  194.     /**
  195.      * Constructor
  196.      */
  197.     public function __construct()
  198.     {
  199.         $this->event = new \Doctrine\Common\Collections\ArrayCollection();
  200.     }
  201.     /**
  202.      * Add event
  203.      *
  204.      * @param \App\Entity\Gos\SalesManagoEvent $event
  205.      *
  206.      * @return SalesManagoEventType
  207.      */
  208.     public function addEvent(\App\Entity\Gos\SalesManagoEvent $event)
  209.     {
  210.         $this->event[] = $event;
  211.         return $this;
  212.     }
  213.     /**
  214.      * Remove event
  215.      *
  216.      * @param \App\Entity\Gos\SalesManagoEvent $event
  217.      */
  218.     public function removeEvent(\App\Entity\Gos\SalesManagoEvent $event)
  219.     {
  220.         $this->event->removeElement($event);
  221.     }
  222.     /**
  223.      * Get event
  224.      *
  225.      * @return \Doctrine\Common\Collections\Collection
  226.      */
  227.     public function getEvent()
  228.     {
  229.         return $this->event;
  230.     }
  231. }