src/Entity/ProspectOnStoreStatus.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Enum\ProspectOnStoreStatusEnum;
  4. use DateTime;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Gedmo\Mapping\Annotation as Gedmo;
  7. use phpDocumentor\Reflection\Types\Self_;
  8. /**
  9.  * @ORM\Entity(repositoryClass="App\Repository\ProspectOnStoreStatusRepository")
  10.  * @ORM\EntityListeners({"App\Listener\ProspectOnStoreStatusListener"})
  11.  */
  12. class ProspectOnStoreStatus
  13. {
  14.     const ORIGIN_AUTO 'auto';
  15.     const ORIGIN_HUBSPOT 'hs';
  16.     const ORIGIN_ADMIN 'admin';
  17.     /**
  18.      * @ORM\Id()
  19.      * @ORM\GeneratedValue()
  20.      * @ORM\Column(type="integer")
  21.      */
  22.     private $id;
  23.     /**
  24.      * @ORM\Column(type="integer")
  25.      *  1 == Mauvais
  26.      *  2 == A recontacter
  27.      *  3 == RDV pris
  28.      *  4 == Faux numéro
  29.      *  5 == Hors cible
  30.      *  6 == Vente réalisée
  31.      *  7 == Déjà équipé
  32.      *  8 == Trop éloigné
  33.      *  9 == Injoignable
  34.      *  10 == Non appareillable
  35.      *  11 == Autre
  36.      *  12 == RDV annulé
  37.      *  13 == RDV venu
  38.      *  14 == RDV pas venu
  39.      *
  40.      */
  41.     private $status;
  42.     /**
  43.      * @ORM\Column(type="text", nullable=true)
  44.      */
  45.     private $comment;
  46.     /**
  47.      * @ORM\Column(type="datetime")
  48.      * @Gedmo\Timestampable(on="create")
  49.      */
  50.     private $created;
  51.     /**
  52.      * @ORM\Column(type="datetime", nullable=true)
  53.      * @var DateTime
  54.      */
  55.     private $dateMeeting;
  56.     /**
  57.      * @ORM\Column(type="boolean")
  58.      * @var boolean
  59.      */
  60.     private $isSmsMeetingPoint false;
  61.     /**
  62.      * @ORM\Column(type="datetime", nullable=true)
  63.      * @var DateTime
  64.      */
  65.     private $dateCallback;
  66.     /**
  67.      * @ORM\Column(type="string", length=5, nullable=true)
  68.      * @var string
  69.      */
  70.     private $callbackReminderState;
  71.     /**
  72.      * @ORM\Column(type="string", length=255, nullable=true)
  73.      * @var string
  74.      */
  75.     private $callbackReminderEmail;
  76.     /**
  77.      * @ORM\ManyToOne(targetEntity="App\Entity\ProspectOnStore", inversedBy="prospectOnStoreStatus")
  78.      * @ORM\JoinColumn(nullable=true)
  79.      */
  80.     private $prospectOnStore;
  81.     /**
  82.      * @ORM\ManyToOne(targetEntity=User::class)
  83.      * @ORM\JoinColumn(nullable=true)
  84.      * @Gedmo\Blameable(on="create")
  85.      */
  86.     private $author;
  87.     /**
  88.      * @ORM\Column(type="string", length=5, nullable=true)
  89.      */
  90.     private $origin;
  91.     public function getId(): ?int
  92.     {
  93.         return $this->id;
  94.     }
  95.     public function getStatus(): ?int
  96.     {
  97.         return $this->status;
  98.     }
  99.     public function setStatus(?int $status): self
  100.     {
  101.         $this->status $status;
  102.         return $this;
  103.     }
  104.     public function getComment(): ?string
  105.     {
  106.         return $this->comment;
  107.     }
  108.     public function setComment(?string $comment): self
  109.     {
  110.         $this->comment $comment;
  111.         return $this;
  112.     }
  113.     public function getCreated(): ?\DateTimeInterface
  114.     {
  115.         return $this->created;
  116.     }
  117.     public function setCreated(\DateTimeInterface $created): self
  118.     {
  119.         $this->created $created;
  120.         return $this;
  121.     }
  122.     public function getDateMeeting(): ?\DateTimeInterface
  123.     {
  124.         return $this->dateMeeting;
  125.     }
  126.     public function setDateMeeting(\DateTimeInterface $dateMeeting): self
  127.     {
  128.         $this->dateMeeting $dateMeeting;
  129.         return $this;
  130.     }
  131.     public function getIsSmsMeetingPoint(): ?bool
  132.     {
  133.         return $this->isSmsMeetingPoint;
  134.     }
  135.     public function setIsSmsMeetingPoint(bool $isSmsMeetingPoint): self
  136.     {
  137.         $this->isSmsMeetingPoint $isSmsMeetingPoint;
  138.         return $this;
  139.     }
  140.     /**
  141.      * @return ProspectOnStore|null
  142.      */
  143.     public function getProspectOnStore(): ?ProspectOnStore
  144.     {
  145.         return $this->prospectOnStore;
  146.     }
  147.     /**
  148.      * @param ProspectOnStore|null $prospect
  149.      * @return $this
  150.      */
  151.     public function setProspectOnStore(?ProspectOnStore $prospect): self
  152.     {
  153.         $this->prospectOnStore $prospect;
  154.         return $this;
  155.     }
  156.     /**
  157.      * @return DateTime
  158.      */
  159.     public function getDateCallback(): ?DateTime
  160.     {
  161.         return $this->dateCallback;
  162.     }
  163.     /**
  164.      * @param DateTime $dateCallback
  165.      */
  166.     public function setDateCallback(?DateTime $dateCallback): void
  167.     {
  168.         $this->dateCallback $dateCallback;
  169.     }
  170.     /**
  171.      * @return string
  172.      */
  173.     public function getCallbackReminderState(): ?string
  174.     {
  175.         return $this->callbackReminderState;
  176.     }
  177.     /**
  178.      * @param string $callbackReminderState
  179.      */
  180.     public function setCallbackReminderState(string $callbackReminderState): void
  181.     {
  182.         $this->callbackReminderState $callbackReminderState;
  183.     }
  184.     /**
  185.      * @return string
  186.      */
  187.     public function getCallbackReminderEmail(): ?string
  188.     {
  189.         return $this->callbackReminderEmail;
  190.     }
  191.     /**
  192.      * @param string $callbackReminderEmail
  193.      */
  194.     public function setCallbackReminderEmail(string $callbackReminderEmail): void
  195.     {
  196.         $this->callbackReminderEmail $callbackReminderEmail;
  197.     }
  198.     public function getAuthor(): ?User
  199.     {
  200.         return $this->author;
  201.     }
  202.     public function setAuthor(?User $author): self
  203.     {
  204.         $this->author $author;
  205.         return $this;
  206.     }
  207.     public function getOrigin(): ?string
  208.     {
  209.         return $this->origin;
  210.     }
  211.     public function setOrigin(?string $origin): self
  212.     {
  213.         $this->origin $origin;
  214.         return $this;
  215.     }
  216.     /**
  217.      * has the status been created by a MCA admin or automatically (from feedback)
  218.      * @return string|null
  219.      */
  220.     public function isOriginAdminOrAuto(): ?string
  221.     {
  222.         return $this->origin == self::ORIGIN_AUTO || $this->origin == self::ORIGIN_ADMIN || $this->origin == self::ORIGIN_HUBSPOT;
  223.     }
  224.     public function mustTriggerNotification(): ?string
  225.     {
  226.         return $this->status == ProspectOnStoreStatusEnum::APPOINTMENT_MADE
  227.             || $this->status == ProspectOnStoreStatusEnum::SELL_MADE;
  228.     }
  229.     /**
  230.      * has the status been created by a MCA admin
  231.      * @return string|null
  232.      */
  233.     public function isOriginAdmin(): ?string
  234.     {
  235.         return $this->origin == self::ORIGIN_ADMIN;
  236.     }
  237. }