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.         public function getId(): ?string
  76.         {
  77.             return $this->id;
  78.         }
  79.         public function getTicketColumn(): ?string
  80.         {
  81.             return $this->ticketColumn;
  82.         }
  83.         public function setTicketColumn(string $ticketColumn): static
  84.         {
  85.             $this->ticketColumn $ticketColumn;
  86.             return $this;
  87.         }
  88.         public function getMappingValue(): ?string
  89.         {
  90.             return $this->mappingValue;
  91.         }
  92.         public function setMappingValue(?string $mappingValue): static
  93.         {
  94.             $this->mappingValue $mappingValue;
  95.             return $this;
  96.         }
  97.         public function getMappingExtra(): ?string
  98.         {
  99.             return $this->mappingExtra;
  100.         }
  101.         public function setMappingExtra(?string $mappingExtra): static
  102.         {
  103.             $this->mappingExtra $mappingExtra;
  104.             return $this;
  105.         }
  106.         public function getPriority(): ?int
  107.         {
  108.             return $this->priority;
  109.         }
  110.         public function setPriority(int $priority): static
  111.         {
  112.             $this->priority $priority;
  113.             return $this;
  114.         }
  115.         public function isKeyRequired(): ?bool
  116.         {
  117.             return $this->keyRequired;
  118.         }
  119.         public function setKeyRequired(bool $keyRequired): static
  120.         {
  121.             $this->keyRequired $keyRequired;
  122.             return $this;
  123.         }
  124.         public function isTicketNumber(): ?bool
  125.         {
  126.             return $this->ticketNumber;
  127.         }
  128.         public function setTicketNumber(bool $ticketNumber): static
  129.         {
  130.             $this->ticketNumber $ticketNumber;
  131.             return $this;
  132.         }
  133.         public function isTermid(): ?bool
  134.         {
  135.             return $this->termid;
  136.         }
  137.         public function setTermid(bool $termid): static
  138.         {
  139.             $this->termid $termid;
  140.             return $this;
  141.         }
  142.         public function getOperation(): ?Operation
  143.         {
  144.             return $this->operation;
  145.         }
  146.         public function setOperation(?Operation $operation): static
  147.         {
  148.             $this->operation $operation;
  149.             return $this;
  150.         }
  151. }