classes/XLite/Model/Payment/MethodTranslation.php line 23

Open in your IDE?
  1. <?php
  2. /**
  3.  * Copyright (c) 2011-present Qualiteam software Ltd. All rights reserved.
  4.  * See https://www.x-cart.com/license-agreement.html for license details.
  5.  */
  6. namespace XLite\Model\Payment;
  7. use Doctrine\ORM\Mapping as ORM;
  8. /**
  9.  * Payment method multilingual data
  10.  *
  11.  * @ORM\Entity
  12.  * @ORM\Table (name="payment_method_translations",
  13.  *      indexes={
  14.  *          @ORM\Index (name="ci", columns={"code","id"}),
  15.  *          @ORM\Index (name="id", columns={"id"})
  16.  *      }
  17.  * )
  18.  */
  19. class MethodTranslation extends \XLite\Model\Base\Translation
  20. {
  21.     /**
  22.      * Name
  23.      *
  24.      * @var string
  25.      *
  26.      * @ORM\Column (type="string", length=255)
  27.      */
  28.     protected $name;
  29.     /**
  30.      * Title (Name of payment method which is displayed for customer on checkout)
  31.      *
  32.      * @var string
  33.      *
  34.      * @ORM\Column (type="string", length=255)
  35.      */
  36.     protected $title '';
  37.     /**
  38.      * Description
  39.      *
  40.      * @var string
  41.      *
  42.      * @ORM\Column (type="text")
  43.      */
  44.     protected $description '';
  45.     /**
  46.      * Admin description
  47.      *
  48.      * @var string
  49.      *
  50.      * @ORM\Column (type="text")
  51.      */
  52.     protected $adminDescription '';
  53.     /**
  54.      * Alternative admin description
  55.      *
  56.      * @var string
  57.      *
  58.      * @ORM\Column (type="text")
  59.      */
  60.     protected $altAdminDescription '';
  61.     /**
  62.      * Instruction
  63.      *
  64.      * @var string
  65.      *
  66.      * @ORM\Column (type="text")
  67.      */
  68.     protected $instruction '';
  69.     /**
  70.      * @var \XLite\Model\Payment\Method
  71.      *
  72.      * @ORM\ManyToOne (targetEntity="XLite\Model\Payment\Method", inversedBy="translations")
  73.      * @ORM\JoinColumn (name="id", referencedColumnName="method_id", onDelete="CASCADE")
  74.      */
  75.     protected $owner;
  76.     /**
  77.      * Title getter
  78.      * If no title is given then the "name" field must be used
  79.      *
  80.      * @return string
  81.      */
  82.     public function getTitle()
  83.     {
  84.         return $this->title ?: $this->getName();
  85.     }
  86.     /**
  87.      * Admin description getter
  88.      * If no admin description is given then the "description" field must be used
  89.      *
  90.      * @return string
  91.      */
  92.     public function getAdminDescription()
  93.     {
  94.         return $this->adminDescription ?: $this->getDescription();
  95.     }
  96.     /**
  97.      * Set name
  98.      *
  99.      * @param string $name
  100.      * @return MethodTranslation
  101.      */
  102.     public function setName($name)
  103.     {
  104.         $this->name $name;
  105.         return $this;
  106.     }
  107.     /**
  108.      * Get name
  109.      *
  110.      * @return string
  111.      */
  112.     public function getName()
  113.     {
  114.         return $this->name;
  115.     }
  116.     /**
  117.      * Set title
  118.      *
  119.      * @param string $title
  120.      * @return MethodTranslation
  121.      */
  122.     public function setTitle($title)
  123.     {
  124.         $this->title $title;
  125.         return $this;
  126.     }
  127.     /**
  128.      * Set description
  129.      *
  130.      * @param string $description
  131.      * @return MethodTranslation
  132.      */
  133.     public function setDescription($description)
  134.     {
  135.         $this->description $description;
  136.         return $this;
  137.     }
  138.     /**
  139.      * Get description
  140.      *
  141.      * @return string
  142.      */
  143.     public function getDescription()
  144.     {
  145.         return $this->description;
  146.     }
  147.     /**
  148.      * Set adminDescription
  149.      *
  150.      * @param string $adminDescription
  151.      * @return MethodTranslation
  152.      */
  153.     public function setAdminDescription($adminDescription)
  154.     {
  155.         $this->adminDescription $adminDescription;
  156.         return $this;
  157.     }
  158.     /**
  159.      * Set altAdminDescription
  160.      *
  161.      * @param string $altAdminDescription
  162.      * @return MethodTranslation
  163.      */
  164.     public function setAltAdminDescription($altAdminDescription)
  165.     {
  166.         $this->altAdminDescription $altAdminDescription;
  167.         return $this;
  168.     }
  169.     /**
  170.      * Get altAdminDescription
  171.      *
  172.      * @return string
  173.      */
  174.     public function getAltAdminDescription()
  175.     {
  176.         return $this->altAdminDescription;
  177.     }
  178.     /**
  179.      * Set instruction
  180.      *
  181.      * @param string $instruction
  182.      * @return MethodTranslation
  183.      */
  184.     public function setInstruction($instruction)
  185.     {
  186.         $this->instruction $instruction;
  187.         return $this;
  188.     }
  189.     /**
  190.      * Get instruction
  191.      *
  192.      * @return string
  193.      */
  194.     public function getInstruction()
  195.     {
  196.         return $this->instruction;
  197.     }
  198.     /**
  199.      * Get label_id
  200.      *
  201.      * @return integer
  202.      */
  203.     public function getLabelId()
  204.     {
  205.         return $this->label_id;
  206.     }
  207.     /**
  208.      * Set code
  209.      *
  210.      * @param string $code
  211.      * @return MethodTranslation
  212.      */
  213.     public function setCode($code)
  214.     {
  215.         $this->code $code;
  216.         return $this;
  217.     }
  218.     /**
  219.      * Get code
  220.      *
  221.      * @return string
  222.      */
  223.     public function getCode()
  224.     {
  225.         return $this->code;
  226.     }
  227. }