src/Entity/Currency.php line 19

Open in your IDE?
  1. <?php
  2. /**
  3.  * Waluta
  4.  */
  5. namespace App\Entity;
  6. use Knp\DoctrineBehaviors\Contract\Entity\SoftDeletableInterface;
  7. use Knp\DoctrineBehaviors\Model\SoftDeletable\SoftDeletableTrait;
  8. use Knp\DoctrineBehaviors\Model\Blameable\BlameableTrait;
  9. use Knp\DoctrineBehaviors\Contract\Entity\BlameableInterface;
  10. use Knp\DoctrineBehaviors\Model\Timestampable\TimestampableTrait;
  11. use Knp\DoctrineBehaviors\Contract\Entity\TimestampableInterface;
  12. use Knp\DoctrineBehaviors\Model\Translatable\TranslatableTrait;
  13. use Knp\DoctrineBehaviors\Contract\Entity\TranslatableInterface;
  14. /**
  15.  * @Doctrine\ORM\Mapping\Entity
  16.  * @Doctrine\ORM\Mapping\Table(name="currency")
  17.  */
  18. class Currency implements TranslatableInterfaceBlameableInterfaceTimestampableInterfaceSoftDeletableInterface  {
  19.     use BlameableTrait;
  20.     use TimestampableTrait;
  21.     use TranslatableTrait;
  22.     use SoftDeletableTrait;
  23.     /**
  24.      * @Doctrine\ORM\Mapping\Id
  25.      * @Doctrine\ORM\Mapping\Column(type="integer")
  26.      * @Doctrine\ORM\Mapping\GeneratedValue(strategy="AUTO")
  27.      */
  28.     protected $id;
  29.     /**
  30.      * @Doctrine\ORM\Mapping\Column(type="text", length=255)
  31.      */
  32.     protected $sign;
  33.     /**
  34.      * @Doctrine\ORM\Mapping\Column(name="currency_separator", type="text", length=255)
  35.      */
  36.     protected $separator;
  37.     /**
  38.      * @Doctrine\ORM\Mapping\Column(name="position_price", type="text", length=255)
  39.      */
  40.     protected $position;
  41.     /**
  42.      * Domyślny
  43.      * @Doctrine\ORM\Mapping\Column(type="boolean", options={"default"=0})
  44.      */
  45.     protected $isDefault;
  46.     /**
  47.      * Czy aktywny
  48.      * @Doctrine\ORM\Mapping\Column(type="boolean", options={"default"=0})
  49.      */
  50.     protected $isActive;
  51.     /**
  52.      * @Doctrine\ORM\Mapping\Column(name="factorPln", nullable=true, type="float")
  53.      */
  54.     protected $factorPln;
  55.     /**
  56.      * @Doctrine\ORM\Mapping\Column(name="iso_code", nullable=true, type="string")
  57.      */
  58.     protected $isoCode;
  59.     public function __toString()
  60.     {
  61.         return $this->getSign();
  62.     }
  63.     /**
  64.      * Get id
  65.      *
  66.      * @return integer
  67.      */
  68.     public function getId()
  69.     {
  70.         return $this->id;
  71.     }
  72.     /**
  73.      * Set sign
  74.      *
  75.      * @param string $sign
  76.      *
  77.      * @return Currency
  78.      */
  79.     public function setSign($sign)
  80.     {
  81.         $this->sign $sign;
  82.         return $this;
  83.     }
  84.     /**
  85.      * Get sign
  86.      *
  87.      * @return string
  88.      */
  89.     public function getSign()
  90.     {
  91.         return $this->sign;
  92.     }
  93.     /**
  94.      * Set isDefault
  95.      *
  96.      * @param boolean $isDefault
  97.      *
  98.      * @return Currency
  99.      */
  100.     public function setIsDefault($isDefault)
  101.     {
  102.         $this->isDefault $isDefault;
  103.         return $this;
  104.     }
  105.     /**
  106.      * Get isDefault
  107.      *
  108.      * @return boolean
  109.      */
  110.     public function getIsDefault()
  111.     {
  112.         return $this->isDefault;
  113.     }
  114.     /**
  115.      * Set isActive
  116.      *
  117.      * @param boolean $isActive
  118.      *
  119.      * @return Currency
  120.      */
  121.     public function setIsActive($isActive)
  122.     {
  123.         $this->isActive $isActive;
  124.         return $this;
  125.     }
  126.     /**
  127.      * Get isActive
  128.      *
  129.      * @return boolean
  130.      */
  131.     public function getIsActive()
  132.     {
  133.         return $this->isActive;
  134.     }
  135.     /**
  136.      * Obsługa tłumaczeń
  137.      * @param $method
  138.      * @param $arguments
  139.      * @return mixed
  140.      */
  141.     public function __call($method$arguments)
  142.     {
  143.         return $this->proxyCurrentLocaleTranslation($method$arguments);
  144.     }
  145.     public function getName()
  146.     {
  147.         return $this->translate()->getName();
  148.     }
  149.     /**
  150.      * Set separator
  151.      *
  152.      * @param string $separator
  153.      *
  154.      * @return Currency
  155.      */
  156.     public function setSeparator($separator)
  157.     {
  158.         $this->separator $separator;
  159.         return $this;
  160.     }
  161.     /**
  162.      * Get separator
  163.      *
  164.      * @return string
  165.      */
  166.     public function getSeparator()
  167.     {
  168.         return $this->separator;
  169.     }
  170.     /**
  171.      * Set position
  172.      *
  173.      * @param string $position
  174.      *
  175.      * @return Currency
  176.      */
  177.     public function setPosition($position)
  178.     {
  179.         $this->position $position;
  180.         return $this;
  181.     }
  182.     /**
  183.      * Get position
  184.      *
  185.      * @return string
  186.      */
  187.     public function getPosition()
  188.     {
  189.         return $this->position;
  190.     }
  191.     /**
  192.      * @return mixed
  193.      */
  194.     public function getFactorPln()
  195.     {
  196.         return $this->factorPln;
  197.     }
  198.     /**
  199.      * @param mixed $factorPln
  200.      */
  201.     public function setFactorPln($factorPln): void
  202.     {
  203.         $this->factorPln $factorPln;
  204.     }
  205.     /**
  206.      * @return mixed
  207.      */
  208.     public function getIsoCode()
  209.     {
  210.         return $this->isoCode;
  211.     }
  212.     /**
  213.      * @param mixed $isoCode
  214.      */
  215.     public function setIsoCode($isoCode)
  216.     {
  217.         $this->isoCode $isoCode;
  218.     }
  219. }