classes/XLite/Model/Payment/MethodCountryPosition.php line 25

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
  10.  *
  11.  * @ORM\Entity
  12.  * @ORM\Table  (name="payment_method_country_position",
  13.  *      uniqueConstraints={
  14.  *          @ORM\UniqueConstraint (name="method_country", columns={"method_id","countryCode"})
  15.  *      },
  16.  *      indexes={
  17.  *          @ORM\Index (name="adminPosition", columns={"adminPosition"}),
  18.  *      }
  19.  * )
  20.  */
  21. class MethodCountryPosition extends \XLite\Model\AEntity
  22. {
  23.     /**
  24.      * @var integer
  25.      *
  26.      * @ORM\Id
  27.      * @ORM\GeneratedValue (strategy="AUTO")
  28.      * @ORM\Column         (type="integer")
  29.      */
  30.     protected $id;
  31.     /**
  32.      * Payment method
  33.      *
  34.      * @var \XLite\Model\Payment\Method
  35.      *
  36.      * @ORM\ManyToOne  (targetEntity="XLite\Model\Payment\Method", inversedBy="countryPositions")
  37.      * @ORM\JoinColumn (name="method_id", referencedColumnName="method_id", onDelete="CASCADE")
  38.      */
  39.     protected $paymentMethod;
  40.     /**
  41.      * Country code
  42.      *
  43.      * @var string
  44.      *
  45.      * @ORM\Column (type="string", options={ "fixed": true }, length=2)
  46.      */
  47.     protected $countryCode;
  48.     /**
  49.      * Position in popup
  50.      *
  51.      * @var integer
  52.      *
  53.      * @ORM\Column (type="integer")
  54.      */
  55.     protected $adminPosition 0;
  56.     /**
  57.      * @return int|null
  58.      */
  59.     public function getId(): ?int
  60.     {
  61.         return $this->id;
  62.     }
  63.     /**
  64.      * @param int $id
  65.      */
  66.     public function setId(int $id): void
  67.     {
  68.         $this->id $id;
  69.     }
  70.     /**
  71.      * @return Method
  72.      */
  73.     public function getPaymentMethod(): Method
  74.     {
  75.         return $this->paymentMethod;
  76.     }
  77.     /**
  78.      * @param Method $paymentMethod
  79.      */
  80.     public function setPaymentMethod(Method $paymentMethod): void
  81.     {
  82.         $this->paymentMethod $paymentMethod;
  83.     }
  84.     /**
  85.      * @return string
  86.      */
  87.     public function getCountryCode(): string
  88.     {
  89.         return $this->countryCode;
  90.     }
  91.     /**
  92.      * @param string $countryCode
  93.      */
  94.     public function setCountryCode(string $countryCode): void
  95.     {
  96.         $this->countryCode $countryCode;
  97.     }
  98.     /**
  99.      * @return int
  100.      */
  101.     public function getAdminPosition(): int
  102.     {
  103.         return $this->adminPosition;
  104.     }
  105.     /**
  106.      * @param int $adminPosition
  107.      */
  108.     public function setAdminPosition(int $adminPosition): void
  109.     {
  110.         $this->adminPosition $adminPosition;
  111.     }
  112. }