src/Entity/Slave/OperationKeyMapping.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Slave;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Table(name="eposm_s_operation_key_mapping")
  9.  * @ORM\Entity(repositoryClass="App\Repository\Slave\OperationKeyMappingRepository")
  10.  */
  11. class OperationKeyMapping
  12. {
  13.     public function __toString()
  14.     {
  15.         return $this->mappingValue;
  16.     }
  17.     
  18.     public function displayMappingExtraValue($slug)
  19.     {
  20.         if($this->getMappingExtra() != null){
  21.             $json json_decode($this->getMappingExtra(), true);
  22.             if(array_key_exists($slug$json))
  23.                 return $json[$slug];
  24.             return false;
  25.         }
  26.         return false;
  27.     }
  28.     /**
  29.      * @ORM\Column(name="id", type="bigint")
  30.      * @ORM\Id
  31.      * @ORM\GeneratedValue(strategy="AUTO")
  32.      */
  33.     protected $id;
  34.     /**
  35.      * @ORM\Column(name="ticket_column", type="string", length=191)
  36.      */
  37.     protected $ticketColumn;
  38.     
  39.     /**
  40.      * @ORM\Column(name="mapping_value", type="string", length=191, nullable=true)
  41.      */
  42.     protected $mappingValue;
  43.     
  44.     /**
  45.      * @ORM\Column(name="mapping_extra", type="text", nullable=true)
  46.      */
  47.     protected $mappingExtra;
  48.     
  49.     /**
  50.      * @ORM\Column(name="priority", type="integer")
  51.      */
  52.     protected $priority;
  53.     
  54.     /**
  55.      * @ORM\Column(name="is_key_required", type="boolean")
  56.      */
  57.     protected $keyRequired;
  58.     
  59.     /**
  60.      * @ORM\Column(name="is_ticket_number", type="boolean")
  61.      */
  62.     protected $ticketNumber;
  63.     
  64.     /**
  65.      * @ORM\Column(name="is_termid", type="boolean")
  66.      */
  67.     protected $termid;
  68.     
  69.     // ManyToOne
  70.         /**
  71.          * @ORM\ManyToOne(targetEntity="App\Entity\Slave\Operation", inversedBy="keyMappings")
  72.          * @ORM\JoinColumn(name="operation_id", referencedColumnName="id")
  73.          */
  74.         private $operation;
  75.     //
  76.     public function getId(): ?string
  77.     {
  78.         return $this->id;
  79.     }
  80.     public function getTicketColumn(): ?string
  81.     {
  82.         return $this->ticketColumn;
  83.     }
  84.     public function setTicketColumn(string $ticketColumn): static
  85.     {
  86.         $this->ticketColumn $ticketColumn;
  87.         return $this;
  88.     }
  89.     public function getMappingValue(): ?string
  90.     {
  91.         return $this->mappingValue;
  92.     }
  93.     public function setMappingValue(?string $mappingValue): static
  94.     {
  95.         $this->mappingValue $mappingValue;
  96.         return $this;
  97.     }
  98.     public function getMappingExtra(): ?string
  99.     {
  100.         return $this->mappingExtra;
  101.     }
  102.     public function setMappingExtra(?string $mappingExtra): static
  103.     {
  104.         $this->mappingExtra $mappingExtra;
  105.         return $this;
  106.     }
  107.     public function getPriority(): ?int
  108.     {
  109.         return $this->priority;
  110.     }
  111.     public function setPriority(int $priority): static
  112.     {
  113.         $this->priority $priority;
  114.         return $this;
  115.     }
  116.     public function isKeyRequired(): ?bool
  117.     {
  118.         return $this->keyRequired;
  119.     }
  120.     public function setKeyRequired(bool $keyRequired): static
  121.     {
  122.         $this->keyRequired $keyRequired;
  123.         return $this;
  124.     }
  125.     public function isTicketNumber(): ?bool
  126.     {
  127.         return $this->ticketNumber;
  128.     }
  129.     public function setTicketNumber(bool $ticketNumber): static
  130.     {
  131.         $this->ticketNumber $ticketNumber;
  132.         return $this;
  133.     }
  134.     public function isTermid(): ?bool
  135.     {
  136.         return $this->termid;
  137.     }
  138.     public function setTermid(bool $termid): static
  139.     {
  140.         $this->termid $termid;
  141.         return $this;
  142.     }
  143.     public function getOperation(): ?Operation
  144.     {
  145.         return $this->operation;
  146.     }
  147.     public function setOperation(?Operation $operation): static
  148.     {
  149.         $this->operation $operation;
  150.         return $this;
  151.     }
  152. }