src/Entity/DnsitTranslateModality.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Mask\MarkingCodesMask;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * DnsitTranslateModality
  7.  *
  8.  * @ORM\Table(name="dnsit_translate_modality", indexes={@ORM\Index(name="translate_modality_modality_code_idx", columns={"modality_code"}), @ORM\Index(name="translate_modality_criterion_id_idx", columns={"criterion_id"}), @ORM\Index(name="translate_modality_modality_text_key_idx", columns={"modality_text_key"})})
  9.  * @ORM\Entity(repositoryClass="App\Repository\DnsitTranslateModalityRepository")
  10.  */
  11. class DnsitTranslateModality
  12. {
  13.     /**
  14.      * @var int|null
  15.      *
  16.      * @ORM\Column(name="modality_code", type="bigint", nullable=true)
  17.      */
  18.     private $modalityCode;
  19.     /**
  20.      * @var string|null
  21.      *
  22.      * @ORM\Column(name="modality_text_key", type="string", length=255, nullable=true, unique=true)
  23.      */
  24.     private $modalityTextKey;
  25.     /**
  26.      * @var string|null
  27.      *
  28.      * @ORM\Column(name="en_name", type="string", length=255, nullable=true)
  29.      */
  30.     private $enName;
  31.     /**
  32.      * @var string|null
  33.      *
  34.      * @ORM\Column(name="de_name", type="string", length=255, nullable=true)
  35.      */
  36.     private $deName;
  37.     /**
  38.      * @var string|null
  39.      *
  40.      * @ORM\Column(name="nl_name", type="string", length=255, nullable=true)
  41.      */
  42.     private $nlName;
  43.     /**
  44.      * @var string|null
  45.      *
  46.      * @ORM\Column(name="it_name", type="string", length=255, nullable=true)
  47.      */
  48.     private $itName;
  49.     /**
  50.      * @var string|null
  51.      *
  52.      * @ORM\Column(name="es_name", type="string", length=255, nullable=true)
  53.      */
  54.     private $esName;
  55.     /**
  56.      * @ORM\Column(type="string", length=255, nullable=true)
  57.      */
  58.     private $ptName;
  59.     /**
  60.      * @var int|null
  61.      *
  62.      * @ORM\Column(name="dn_order", type="integer", nullable=true)
  63.      */
  64.     private $order;
  65.     /**
  66.      * @var int|null
  67.      *
  68.      * @ORM\Column(name="entity", type="bigint", nullable=true)
  69.      */
  70.     private $entity;
  71.     /**
  72.      * @var int|null
  73.      *
  74.      * @ORM\Column(name="marking", type="smallint", nullable=true)
  75.      */
  76.     private $marking;
  77.     /**
  78.      * @var string|null
  79.      *
  80.      * @ORM\Column(name="params", type="text", nullable=true)
  81.      */
  82.     private $params;
  83.     /**
  84.      * @var string|null
  85.      *
  86.      * @ORM\Column(name="modality_tag_key", type="string", length=255, nullable=true)
  87.      */
  88.     private $modalityTagKey;
  89.     /**
  90.      * @ORM\Column(type="string",  length=4000, name="text_keys", nullable=true)
  91.      */
  92.     private $textKeys;
  93.     /**
  94.      * @var \DateTime|null
  95.      *
  96.      * @ORM\Column(name="created_at", type="datetime", nullable=true)
  97.      */
  98.     private $createdAt;
  99.     /**
  100.      * @var int|null
  101.      *
  102.      * @ORM\Column(name="created_by", type="bigint", nullable=true)
  103.      */
  104.     private $createdBy;
  105.     /**
  106.      * @var \DateTime|null
  107.      *
  108.      * @ORM\Column(name="updated_at", type="datetime", nullable=true)
  109.      */
  110.     private $updatedAt;
  111.     /**
  112.      * @var int|null
  113.      *
  114.      * @ORM\Column(name="updated_by", type="bigint", nullable=true)
  115.      */
  116.     private $updatedBy;
  117.     /**
  118.      * @var int
  119.      *
  120.      * @ORM\Column(name="id", type="bigint")
  121.      * @ORM\Id
  122.      * @ORM\GeneratedValue(strategy="IDENTITY")
  123.      */
  124.     private $id;
  125.     /**
  126.      * @var \App\Entity\DnsitTranslateCriterion
  127.      *
  128.      * @ORM\ManyToOne(targetEntity="App\Entity\DnsitTranslateCriterion", cascade={"persist"})
  129.      * @ORM\JoinColumns({
  130.      *   @ORM\JoinColumn(name="criterion_id", referencedColumnName="id")
  131.      * })
  132.      */
  133.     private $criterion;
  134.     public function getModalityCode(): ?int
  135.     {
  136.         return $this->modalityCode;
  137.     }
  138.     public function setModalityCode(?int $modalityCode): self
  139.     {
  140.         $this->modalityCode $modalityCode;
  141.         return $this;
  142.     }
  143.     public function getModalityTextKey(): ?string
  144.     {
  145.         return $this->modalityTextKey;
  146.     }
  147.     public function setModalityTextKey(?string $modalityTextKey): self
  148.     {
  149.         $this->modalityTextKey $modalityTextKey;
  150.         return $this;
  151.     }
  152.     public function getEnName(): ?string
  153.     {
  154.         return $this->enName;
  155.     }
  156.     public function setEnName(?string $enName): self
  157.     {
  158.         $this->enName $enName;
  159.         return $this;
  160.     }
  161.     public function getDeName(): ?string
  162.     {
  163.         return $this->deName;
  164.     }
  165.     public function setDeName(?string $deName): self
  166.     {
  167.         $this->deName $deName;
  168.         return $this;
  169.     }
  170.     public function getNlName(): ?string
  171.     {
  172.         return $this->nlName;
  173.     }
  174.     public function setNlName(?string $nlName): self
  175.     {
  176.         $this->nlName $nlName;
  177.         return $this;
  178.     }
  179.     public function getItName(): ?string
  180.     {
  181.         return $this->itName;
  182.     }
  183.     public function setItName(?string $itName): self
  184.     {
  185.         $this->itName $itName;
  186.         return $this;
  187.     }
  188.     public function getEsName(): ?string
  189.     {
  190.         return $this->esName;
  191.     }
  192.     public function setEsName(?string $esName): self
  193.     {
  194.         $this->esName $esName;
  195.         return $this;
  196.     }
  197.     public function getPtName(): ?string
  198.     {
  199.         return $this->ptName;
  200.     }
  201.     public function setPtName(?string $ptName): self
  202.     {
  203.         $this->ptName $ptName;
  204.         return $this;
  205.     }
  206.     public function getOrder(): ?int
  207.     {
  208.         return $this->order;
  209.     }
  210.     public function setOrder(?int $order): self
  211.     {
  212.         $this->order $order;
  213.         return $this;
  214.     }
  215.     public function getEntity(): ?int
  216.     {
  217.         return $this->entity;
  218.     }
  219.     public function setEntity(?int $entity): self
  220.     {
  221.         $this->entity $entity;
  222.         return $this;
  223.     }
  224.     public function getMarking(): ?int
  225.     {
  226.         return $this->marking;
  227.     }
  228.     public function setMarking(?int $marking): self
  229.     {
  230.         $this->marking $marking;
  231.         return $this;
  232.     }
  233.     public function getParams(): ?string
  234.     {
  235.         return $this->params;
  236.     }
  237.     public function setParams(?string $params): self
  238.     {
  239.         $this->params $params;
  240.         return $this;
  241.     }
  242.     public function getCreatedAt(): ?\DateTimeInterface
  243.     {
  244.         return $this->createdAt;
  245.     }
  246.     public function setCreatedAt(?\DateTimeInterface $createdAt): self
  247.     {
  248.         $this->createdAt $createdAt;
  249.         return $this;
  250.     }
  251.     public function getCreatedBy(): ?int
  252.     {
  253.         return $this->createdBy;
  254.     }
  255.     public function setCreatedBy(?int $createdBy): self
  256.     {
  257.         $this->createdBy $createdBy;
  258.         return $this;
  259.     }
  260.     public function getUpdatedAt(): ?\DateTimeInterface
  261.     {
  262.         return $this->updatedAt;
  263.     }
  264.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  265.     {
  266.         $this->updatedAt $updatedAt;
  267.         return $this;
  268.     }
  269.     public function getUpdatedBy(): ?int
  270.     {
  271.         return $this->updatedBy;
  272.     }
  273.     public function setUpdatedBy(?int $updatedBy): self
  274.     {
  275.         $this->updatedBy $updatedBy;
  276.         return $this;
  277.     }
  278.     public function getId(): ?int
  279.     {
  280.         return $this->id;
  281.     }
  282.     public function getCriterion(): ?DnsitTranslateCriterion
  283.     {
  284.         return $this->criterion;
  285.     }
  286.     public function setCriterion(?DnsitTranslateCriterion $criterion): self
  287.     {
  288.         $this->criterion $criterion;
  289.         return $this;
  290.     }
  291.     public function bindLeiData($xmlModality$language) {
  292.         $this->setModalityCode((int) $xmlModality->MODALITE);
  293.     
  294.         $order intval((int) $xmlModality->MODALITE_ORDER);
  295.     
  296.         if ($order || $order == 0) {
  297.             $this->setOrder($order);
  298.         }
  299.     
  300.         switch ($language) {
  301.             case "en":
  302.                 $this->setEnName((string) $xmlModality->MODALITE_NOM);
  303.                 break;
  304.     
  305.             case "de":
  306.                 $this->setDeName((string) $xmlModality->MODALITE_NOM);
  307.                 break;
  308.     
  309.             case "nl":
  310.                 $this->setNlName((string) $xmlModality->MODALITE_NOM);
  311.                 break;
  312.     
  313.             case "it":
  314.                 $this->setItName((string) $xmlModality->MODALITE_NOM);
  315.                 break;
  316.     
  317.             case "es":
  318.                 $this->setEsName((string) $xmlModality->MODALITE_NOM);
  319.                 break;
  320.             case "pt":
  321.                 $this->setPtName((string) $xmlModality->MODALITE_NOM);
  322.                 break;
  323.         }
  324.         $this->setMarking(MarkingCodesMask::LEI);
  325.     }
  326.     public function bindTourinsoftData($jsonModality$language) {
  327.     
  328.         // $this->setModalityCode($jsonModality->MODALITE);
  329.         $this->setModalityTextKey(strtoupper($jsonModality->SyndicItemID));
  330.     
  331.         $order intval($jsonModality->ItemOrder);
  332.     
  333.         if ($order || $order == 0) {
  334.             $this->setOrder($order);
  335.         }
  336.         switch ($language) {
  337.             case "en":
  338.                 $this->setEnName($jsonModality->ItemValue);
  339.                 break;
  340.     
  341.             case "de":
  342.                 $this->setDeName($jsonModality->ItemValue);
  343.                 break;
  344.     
  345.             case "nl":
  346.                 $this->setNlName($jsonModality->ItemValue);
  347.                 break;
  348.     
  349.             case "it":
  350.                 $this->setItName($jsonModality->ItemValue);
  351.                 break;
  352.     
  353.             case "es":
  354.                 $this->setEsName($jsonModality->ItemValue);
  355.                 break;
  356.             case "pt":
  357.                 $this->setPtName($jsonModality->ItemValue);
  358.                 break;
  359.         }
  360.         $this->setMarking(MarkingCodesMask::TOURINSOFT);
  361.     }
  362.     public function getModalityTagKey(): ?string
  363.     {
  364.         return $this->modalityTagKey;
  365.     }
  366.     public function setModalityTagKey(?string $modalityTagKey): self
  367.     {
  368.         $this->modalityTagKey $modalityTagKey;
  369.         return $this;
  370.     }
  371.     public function getTextKeys(): ?string
  372.     {
  373.         return $this->textKeys;
  374.     }
  375.     public function setTextKeys(?string $textKeys): self
  376.     {
  377.         $this->textKeys $textKeys;
  378.         return $this;
  379.     }
  380. }