src/Entity/Language.php line 19

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Knp\DoctrineBehaviors\Contract\Entity\SoftDeletableInterface;
  4. use Knp\DoctrineBehaviors\Model\SoftDeletable\SoftDeletableTrait;
  5. use Knp\DoctrineBehaviors\Model\Blameable\BlameableTrait;
  6. use Knp\DoctrineBehaviors\Contract\Entity\BlameableInterface;
  7. use Knp\DoctrineBehaviors\Model\Timestampable\TimestampableTrait;
  8. use Knp\DoctrineBehaviors\Contract\Entity\TimestampableInterface;
  9. use Knp\DoctrineBehaviors\Model\Translatable\TranslatableTrait;
  10. use Knp\DoctrineBehaviors\Contract\Entity\TranslatableInterface;
  11. use Doctrine\ORM\Mapping as ORM;
  12. /**
  13.  * @Doctrine\ORM\Mapping\Entity
  14.  * @Doctrine\ORM\Mapping\Table(name="language")
  15.  */
  16. class Language implements TranslatableInterfaceBlameableInterfaceTimestampableInterfaceSoftDeletableInterface  {
  17.     use BlameableTrait;
  18.     use TimestampableTrait;
  19.     use TranslatableTrait;
  20.     use SoftDeletableTrait;
  21.     /**
  22.      * @Doctrine\ORM\Mapping\Id
  23.      * @Doctrine\ORM\Mapping\Column(type="integer")
  24.      * @Doctrine\ORM\Mapping\GeneratedValue(strategy="AUTO")
  25.      */
  26.     protected $id;
  27.     /**
  28.      * @Doctrine\ORM\Mapping\Column(type="string", length=5)
  29.      */
  30.     protected $locale;
  31.     /**
  32.      * @Doctrine\ORM\Mapping\Column(type="text")
  33.      */
  34.     protected $domain;
  35.     /**
  36.      * @Doctrine\ORM\Mapping\Column(type="boolean", options={"default"=0})
  37.      */
  38.     protected $isActive;
  39.     /**
  40.      * @Doctrine\ORM\Mapping\Column(type="boolean", options={"default"=0})
  41.      */
  42.     protected $isDefault;
  43.     /**
  44.      * @Doctrine\ORM\Mapping\ManyToOne(targetEntity="App\Entity\Currency")
  45.      * @Doctrine\ORM\Mapping\JoinColumn(name="currency_id", referencedColumnName="id")
  46.      */
  47.     protected $currency;
  48.     /**
  49.      * @var string
  50.      *
  51.      * @ORM\Column(name="helpline", type="string", length=255, nullable=true)
  52.      */
  53.     private $helpline;
  54.     /**
  55.      * @var string
  56.      *
  57.      * @ORM\Column(name="rounding_precision", type="string", length=255, nullable=true, options={"default"=2})
  58.      */
  59.     private $roundingPrecision 2;
  60.     /**
  61.      * @var string
  62.      *
  63.      * @ORM\Column(name="phone", type="string", length=255, nullable=true)
  64.      */
  65.     private $phone;
  66.     /**
  67.      * @var string
  68.      *
  69.      * @ORM\Column(name="address", type="string", length=255, nullable=true)
  70.      */
  71.     private $address;
  72.     /**
  73.      * @var string
  74.      *
  75.      * @ORM\Column(name="shop_name", type="string", length=255, nullable=true)
  76.      */
  77.     private $shopName;
  78.     /**
  79.      * @var string
  80.      *
  81.      * @ORM\Column(name="email", type="string", length=255, nullable=true)
  82.      */
  83.     private $email;
  84.     /**
  85.      * @var string
  86.      *
  87.      * @ORM\Column(name="facebook", type="string", length=255, nullable=true)
  88.      */
  89.     private $facebook;
  90.     /**
  91.      * @var string
  92.      *
  93.      * @ORM\Column(name="instagram", type="string", length=255, nullable=true)
  94.      */
  95.     private $instagram;
  96.     /**
  97.      * @var string
  98.      *
  99.      * @ORM\Column(name="youtube", type="string", length=255, nullable=true)
  100.      */
  101.     private $youtube;
  102.     /**
  103.      * @var string
  104.      *
  105.      * @ORM\Column(name="store_url", type="string", length=255, nullable=true)
  106.      */
  107.     private $storeUrl;
  108.     /**
  109.      * @Doctrine\ORM\Mapping\Column(name="password_protected", type="boolean", options={"default"=0}, nullable=true)
  110.      */
  111.     protected $passwordProtected;
  112.     /**
  113.      * @var string
  114.      *
  115.      * @ORM\Column(name="store_password", type="string", length=255, nullable=true)
  116.      */
  117.     private $password;
  118.     /**
  119.      * @Doctrine\ORM\Mapping\Column(type="string", name="fb_pixel", length=255, nullable=true)
  120.      */
  121.     protected $fbPixel;
  122.     /**
  123.      * @Doctrine\ORM\Mapping\Column(type="text", name="fb_token", nullable=true)
  124.      */
  125.     protected $fbToken;
  126.     /**
  127.      * @Doctrine\ORM\Mapping\Column(type="boolean", options={"default"=0}, name="is_comments")
  128.      */
  129.     protected $isComments;
  130.     /**
  131.      * @Doctrine\ORM\Mapping\Column(type="integer", options={"default"=0}, name="send_comment_request_days")
  132.      */
  133.     protected $sendCommentRequestDays;
  134.     static public function getLocales() {
  135.         return ['pl''cz''sk''ro'];
  136.     }
  137.     /**
  138.      * @return string
  139.      */
  140.     public function getStoreEmail()
  141.     {
  142.         return $this->storeEmail;
  143.     }
  144.     /**
  145.      * @param string $storeEmail
  146.      */
  147.     public function setStoreEmail(string $storeEmail)
  148.     {
  149.         $this->storeEmail $storeEmail;
  150.     }
  151.     /**
  152.      * @return string
  153.      */
  154.     public function getGetResponseCampaignId()
  155.     {
  156.         return $this->getResponseCampaignId;
  157.     }
  158.     /**
  159.      * @param string $getResponseCampaignId
  160.      */
  161.     public function setGetResponseCampaignId(string $getResponseCampaignId)
  162.     {
  163.         $this->getResponseCampaignId $getResponseCampaignId;
  164.     }
  165.     /**
  166.      * @var string
  167.      *
  168.      * @ORM\Column(name="store_email", type="string", length=255, nullable=true)
  169.      */
  170.     private $storeEmail;
  171.     /**
  172.      * @return string
  173.      */
  174.     public function getAdminStoreEmail()
  175.     {
  176.         return $this->adminStoreEmail;
  177.     }
  178.     /**
  179.      * @param string $adminStoreEmail
  180.      */
  181.     public function setAdminStoreEmail(string $adminStoreEmail)
  182.     {
  183.         $this->adminStoreEmail $adminStoreEmail;
  184.     }
  185.     /**
  186.      * @var string
  187.      *
  188.      * @ORM\Column(name="admin_store_email", type="string", length=255, nullable=true)
  189.      */
  190.     private $adminStoreEmail;
  191.     /**
  192.      * @var string
  193.      *
  194.      * @ORM\Column(name="complaint_email", type="string", length=255, nullable=true)
  195.      */
  196.     private $complaintEmail;
  197.     /**
  198.      * @var string
  199.      *
  200.      * @ORM\Column(name="product_return_email", type="string", length=255, nullable=true)
  201.      */
  202.     private $productReturnEmail;
  203.     /**
  204.      * @var string
  205.      *
  206.      * @ORM\Column(name="getresponse_campaign_id", type="string", length=255, nullable=true)
  207.      */
  208.     private $getResponseCampaignId;
  209.     /**
  210.      * @return string
  211.      */
  212.     public function getInstagram()
  213.     {
  214.         return $this->instagram;
  215.     }
  216.     /**
  217.      * @param string $instagram
  218.      */
  219.     public function setInstagram(string $instagram): void
  220.     {
  221.         $this->instagram $instagram;
  222.     }
  223.     /**
  224.      * @return string
  225.      */
  226.     public function getStoreUrl()
  227.     {
  228.         return $this->storeUrl;
  229.     }
  230.     /**
  231.      * @param string $storeUrl
  232.      */
  233.     public function setStoreUrl(string $storeUrl): void
  234.     {
  235.         $this->storeUrl $storeUrl;
  236.     }
  237.     public function __construct()
  238.     {
  239.     }
  240.     public function getId()
  241.     {
  242.         return $this->id;
  243.     }
  244.     
  245.     /**
  246.      * Set locale
  247.      *
  248.      * @param string $locale
  249.      * @return Language
  250.      */
  251.     public function setLocale($locale)
  252.     {
  253.         $this->locale $locale;
  254.         return $this;
  255.     }
  256.     /**
  257.      * Get locale
  258.      *
  259.      * @return string
  260.      */
  261.     public function getLocale()
  262.     {
  263.         return $this->locale;
  264.     }
  265.     public function getLocaleShort()
  266.     {
  267.         return substr($this->getLocale(), 02);
  268.     }
  269.     /**
  270.      * Set isActive
  271.      *
  272.      * @param boolean $isActive
  273.      * @return Language
  274.      */
  275.     public function setIsActive($isActive)
  276.     {
  277.         $this->isActive $isActive;
  278.         return $this;
  279.     }
  280.     /**
  281.      * Get isActive
  282.      *
  283.      * @return boolean
  284.      */
  285.     public function getIsActive()
  286.     {
  287.         return $this->isActive;
  288.     }
  289.     /**
  290.      * Set isDefault
  291.      *
  292.      * @param boolean $isDefault
  293.      * @return Language
  294.      */
  295.     public function setIsDefault($isDefault)
  296.     {
  297.         $this->isDefault $isDefault;
  298.         return $this;
  299.     }
  300.     /**
  301.      * Get isDefault
  302.      *
  303.      * @return boolean
  304.      */
  305.     public function getIsDefault()
  306.     {
  307.         return $this->isDefault;
  308.     }
  309.     /**
  310.      * Obsługa tłumaczeń
  311.      * @param $method
  312.      * @param $arguments
  313.      * @return mixed
  314.      */
  315.     public function __call($method$arguments)
  316.     {
  317.         return $this->proxyCurrentLocaleTranslation($method$arguments);
  318.     }
  319.     public function getName(){
  320.         return $this->translate()->getName();
  321.     }
  322.     /**
  323.      * Set currency
  324.      *
  325.      * @param \App\Entity\Currency $currency
  326.      *
  327.      * @return Language
  328.      */
  329.     public function setCurrency(\App\Entity\Currency $currency null)
  330.     {
  331.         $this->currency $currency;
  332.         return $this;
  333.     }
  334.     /**
  335.      * Get currency
  336.      *
  337.      * @return \App\Entity\Currency
  338.      */
  339.     public function getCurrency()
  340.     {
  341.         return $this->currency;
  342.     }
  343.     public function getDomain(): ?string
  344.     {
  345.         return $this->domain;
  346.     }
  347.     public function setDomain(string $domain): self
  348.     {
  349.         $this->domain $domain;
  350.         return $this;
  351.     }
  352.     public function getHelpline(): ?string
  353.     {
  354.         return $this->helpline;
  355.     }
  356.     public function setHelpline(?string $helpline): self
  357.     {
  358.         $this->helpline $helpline;
  359.         return $this;
  360.     }
  361.     public function getPhone(): ?string
  362.     {
  363.         return $this->phone;
  364.     }
  365.     public function setPhone(?string $phone): self
  366.     {
  367.         $this->phone $phone;
  368.         return $this;
  369.     }
  370.     public function getAddress(): ?string
  371.     {
  372.         return $this->address;
  373.     }
  374.     public function setAddress(?string $address): self
  375.     {
  376.         $this->address $address;
  377.         return $this;
  378.     }
  379.     public function getShopName(): ?string
  380.     {
  381.         return $this->shopName;
  382.     }
  383.     public function setShopName(?string $shopName): self
  384.     {
  385.         $this->shopName $shopName;
  386.         return $this;
  387.     }
  388.     public function getEmail(): ?string
  389.     {
  390.         return $this->email;
  391.     }
  392.     public function setEmail(?string $email): self
  393.     {
  394.         $this->email $email;
  395.         return $this;
  396.     }
  397.     public function getFacebook(): ?string
  398.     {
  399.         return $this->facebook;
  400.     }
  401.     public function setFacebook(?string $facebook): self
  402.     {
  403.         $this->facebook $facebook;
  404.         return $this;
  405.     }
  406.     public function getYoutube(): ?string
  407.     {
  408.         return $this->youtube;
  409.     }
  410.     public function setYoutube(?string $youtube): self
  411.     {
  412.         $this->youtube $youtube;
  413.         return $this;
  414.     }
  415.     /**
  416.      * @return string
  417.      */
  418.     public function getRoundingPrecision()
  419.     {
  420.         return $this->roundingPrecision;
  421.     }
  422.     /**
  423.      * @param string $roundingPrecision
  424.      */
  425.     public function setRoundingPrecision($roundingPrecision)
  426.     {
  427.         $this->roundingPrecision $roundingPrecision;
  428.     }
  429.     public function getPrecision() {
  430.         $precision $this->getRoundingPrecision();
  431.         return $precision;
  432.     }
  433.     /**
  434.      * @return mixed
  435.      */
  436.     public function getPasswordProtected()
  437.     {
  438.         return $this->passwordProtected;
  439.     }
  440.     /**
  441.      * @param mixed $passwordProtected
  442.      */
  443.     public function setPasswordProtected($passwordProtected)
  444.     {
  445.         $this->passwordProtected $passwordProtected;
  446.     }
  447.     /**
  448.      * @return string
  449.      */
  450.     public function getPassword()
  451.     {
  452.         return $this->password;
  453.     }
  454.     /**
  455.      * @param string $password
  456.      */
  457.     public function setPassword($password)
  458.     {
  459.         $this->password $password;
  460.     }
  461.     public function getGa4Code() {
  462.         if ($this->getId() == 1) {
  463.             return 'PLN';
  464.         }
  465.         if ($this->getId() == 2) {
  466.             return 'CZK';
  467.         }
  468.         if ($this->getId() == 3) {
  469.             return 'EUR';
  470.         }
  471.         if ($this->getId() == 4) {
  472.             return 'RON';
  473.         }
  474.         return 'PLN';
  475.     }
  476.     /**
  477.      * @return string
  478.      */
  479.     public function getComplaintEmail()
  480.     {
  481.         return $this->complaintEmail;
  482.     }
  483.     /**
  484.      * @param string $complaintEmail
  485.      */
  486.     public function setComplaintEmail($complaintEmail): void
  487.     {
  488.         $this->complaintEmail $complaintEmail;
  489.     }
  490.     /**
  491.      * @return string
  492.      */
  493.     public function getProductReturnEmail()
  494.     {
  495.         return $this->productReturnEmail;
  496.     }
  497.     /**
  498.      * @param string $productReturnEmail
  499.      */
  500.     public function setProductReturnEmail($productReturnEmail)
  501.     {
  502.         $this->productReturnEmail $productReturnEmail;
  503.     }
  504.     /**
  505.      * @return mixed
  506.      */
  507.     public function getFbPixel()
  508.     {
  509.         return $this->fbPixel;
  510.     }
  511.     /**
  512.      * @param mixed $fbPixel
  513.      */
  514.     public function setFbPixel($fbPixel): void
  515.     {
  516.         $this->fbPixel $fbPixel;
  517.     }
  518.     /**
  519.      * @return mixed
  520.      */
  521.     public function getFbToken()
  522.     {
  523.         return $this->fbToken;
  524.     }
  525.     /**
  526.      * @param mixed $fbToken
  527.      */
  528.     public function setFbToken($fbToken): void
  529.     {
  530.         $this->fbToken $fbToken;
  531.     }
  532.     /**
  533.      * @return mixed
  534.      */
  535.     public function getIsComments()
  536.     {
  537.         return $this->isComments;
  538.     }
  539.     /**
  540.      * @param mixed $isComments
  541.      */
  542.     public function setIsComments($isComments): void
  543.     {
  544.         $this->isComments $isComments;
  545.     }
  546.     /**
  547.      * @return mixed
  548.      */
  549.     public function getSendCommentRequestDays()
  550.     {
  551.         return $this->sendCommentRequestDays;
  552.     }
  553.     /**
  554.      * @param mixed $sendCommentRequestDays
  555.      */
  556.     public function setSendCommentRequestDays($sendCommentRequestDays): void
  557.     {
  558.         $this->sendCommentRequestDays $sendCommentRequestDays;
  559.     }
  560. }