src/Entity/DivisaTranslation.php line 20

  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\DBAL\Types\Types;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Knp\DoctrineBehaviors\Contract\Entity\TranslationInterface;
  6. use Knp\DoctrineBehaviors\Model\Translatable\TranslationTrait;
  7. use Knp\DoctrineBehaviors\Model\Sluggable\SluggableTrait;
  8. use Knp\DoctrineBehaviors\Contract\Entity\SluggableInterface;
  9. /**
  10.  * DivisaIdioma
  11.  * 
  12.  * @ORM\Table(name="divisa_translation")
  13.  * @ORM\Entity
  14.  */
  15. class DivisaTranslation implements TranslationInterface//, SluggableInterface
  16. {
  17.     use TranslationTrait;
  18. //     use SluggableTrait;
  19.     /**
  20.      * @var integer
  21.      *
  22.      * @ORM\Column(name="id", type="integer")
  23.      * @ORM\Id
  24.      * @ORM\GeneratedValue(strategy="AUTO")
  25.      */
  26.     private $id;
  27.     /**
  28.      * @var string
  29.      *
  30.      * @ORM\Column(name="altBanner", type="string", length=255, nullable=true)
  31.      *
  32.      */
  33.     private $altBanner;
  34.     /**
  35.     * ORM\ManyToOne(targetEntity="App\Entity\Divisa", inversedBy="traducciones")
  36.     * ORM\JoinColumn(name="divisa", referencedColumnName="id", onDelete="cascade")
  37.     */
  38. //     private $divisa;
  39.     /**
  40.      * @var string
  41.      *
  42.      * @ORM\Column(name="nombre", type="string", length=255)
  43.      */
  44.     private $nombre;
  45.     /**
  46.      * @var string
  47.      *
  48.      * @ORM\Column(name="texto1", type="text")
  49.      */
  50.     private $texto1;
  51.     /**
  52.      * @var string
  53.      *
  54.      * @ORM\Column(name="texto2", type="text")
  55.      */
  56.     private $texto2;
  57.     /**
  58.      * @var string
  59.      *
  60.      * @ORM\Column(name="meta_keywords", type="string", length=255, nullable=true)
  61.      */
  62.     private $metaKeywords "";
  63.     /**
  64.      * @var string
  65.      *
  66.      * @ORM\Column(name="meta_description", type="string", length=255, nullable=true)
  67.      */
  68.     private $metaDescription "";
  69.     /**
  70.      * @var string
  71.      *
  72.      * @ORM\Column(name="meta_title", type="string", length=255, nullable=true)
  73.      */
  74.     private $metaTitle "";
  75.     /**
  76.      * @var string
  77.      *
  78.      * @ORM\Column(name="nombrebanco", type="string", length=1000, nullable=true)
  79.      */
  80.     private $nombrebanco;
  81.     /**
  82.      * @var boolean
  83.      *
  84.      * @ORM\Column(name="mostrarTop", type="boolean", nullable=true)
  85.      */
  86.     private $mostrarTop;
  87.     /**
  88.      * @var boolean
  89.      *
  90.      * @ORM\Column(name="mostrarFoot", type="boolean", nullable=true)
  91.      */
  92.     private $mostrarFoot;
  93.     
  94.     /**
  95.      * @var string
  96.      *
  97.      * @ORM\Column(name="slug", type="string", length=255, nullable=true)
  98.      */
  99.     private $slug;
  100.         
  101.     
  102.     
  103.     public function getSluggableFields(): array
  104.     {
  105.         return ['nombre'];
  106.     }
  107.     /**
  108.      * Get id
  109.      *
  110.      * @return integer 
  111.      */
  112.     public function getId()
  113.     {
  114.         return $this->id;
  115.     }
  116.     /**
  117.      * Set divisa
  118.      *
  119.      * @param Divisa $divisa
  120.      * @return DivisaIdioma
  121.      */
  122. //     public function setDivisa(Divisa $divisa)
  123. //     {
  124. //         $this->divisa = $divisa;
  125. //
  126. //         return $this;
  127. //     }
  128.     /**
  129.      * Get divisa
  130.      *
  131.      * @return Divisa
  132.      */
  133. //     public function getDivisa()
  134. //     {
  135. //         return $this->divisa;
  136. //     }
  137.     /**
  138.      * Set nombre
  139.      *
  140.      * @param string $nombre
  141.      * @return DivisaIdioma
  142.      */
  143.     public function setNombre($nombre)
  144.     {
  145.         $this->nombre $nombre;
  146.         return $this;
  147.     }
  148.     /**
  149.      * Get nombre
  150.      *
  151.      * @return string 
  152.      */
  153.     public function getNombre()
  154.     {
  155.         return $this->nombre;
  156.     }
  157.     /**
  158.      * Set texto1
  159.      *
  160.      * @param string $texto1
  161.      * @return DivisaIdioma
  162.      */
  163.     public function setTexto1($texto1)
  164.     {
  165.         $this->texto1 $texto1;
  166.         return $this;
  167.     }
  168.     /**
  169.      * Get texto1
  170.      *
  171.      * @return string 
  172.      */
  173.     public function getTexto1()
  174.     {
  175.         return $this->texto1;
  176.     }
  177.     /**
  178.      * Set texto2
  179.      *
  180.      * @param string $texto2
  181.      * @return DivisaIdioma
  182.      */
  183.     public function setTexto2($texto2)
  184.     {
  185.         $this->texto2 $texto2;
  186.         return $this;
  187.     }
  188.     /**
  189.      * Get texto2
  190.      *
  191.      * @return string 
  192.      */
  193.     public function getTexto2()
  194.     {
  195.         return $this->texto2;
  196.     }
  197.     /**
  198.      * Set nombrebanco
  199.      *
  200.      * @param string $nombrebanco
  201.      * @return nombreBanco
  202.      */
  203.     public function setNombrebanco($nombrebanco)
  204.     {
  205.         $this->nombrebanco $nombrebanco;
  206.         return $this;
  207.     }
  208.     /**
  209.      * Get nombrebanco
  210.      *
  211.      * @return string 
  212.      */
  213.     public function getNombrebanco()
  214.     {
  215.         return $this->nombrebanco;
  216.     }
  217.     static private function slugify($text)
  218.     { 
  219.       // replace non letter or digits by -
  220.       $text preg_replace('~[^\\pL\d]+~u''-'$text);
  221.       // trim
  222.       $text trim($text'-');
  223.       // transliterate
  224.       $text iconv('utf-8''us-ascii//TRANSLIT'$text);
  225.       // lowercase
  226.       $text strtolower($text);
  227.       // remove unwanted characters
  228.       $text preg_replace('~[^-\w]+~'''$text);
  229.       if (empty($text))
  230.       {
  231.         return 'n-a';
  232.       }
  233.       return $text;
  234.     }
  235.         /**
  236.      * Set metaKeywords
  237.      *
  238.      * @param string $metaKeywords
  239.      * @return Entrada
  240.      */
  241.     public function setMetaKeywords($metaKeywords)
  242.     {
  243.         $this->metaKeywords $metaKeywords;
  244.         return $this;
  245.     }
  246.     /**
  247.      * Get metaKeywords
  248.      *
  249.      * @return string 
  250.      */
  251.     public function getMetaKeywords()
  252.     {
  253.         return $this->metaKeywords;
  254.     }
  255.     /**
  256.      * Set metaDescription
  257.      *
  258.      * @param string $metaDescription
  259.      * @return Entrada
  260.      */
  261.     public function setMetaDescription($metaDescription)
  262.     {
  263.         $this->metaDescription $metaDescription;
  264.         return $this;
  265.     }
  266.     /**
  267.      * Get metaDescription
  268.      *
  269.      * @return string 
  270.      */
  271.     public function getMetaDescription()
  272.     {
  273.         return $this->metaDescription;
  274.     }
  275.     /**
  276.      * Set metaTitle
  277.      *
  278.      * @param string $metaTitle
  279.      * @return Entrada
  280.      */
  281.     public function setMetaTitle($metaTitle)
  282.     {
  283.         $this->metaTitle $metaTitle;
  284.         return $this;
  285.     }
  286.     /**
  287.      * Get metaTitle
  288.      *
  289.      * @return string 
  290.      */
  291.     public function getMetaTitle()
  292.     {
  293.         return $this->metaTitle;
  294.     }
  295.     /**
  296.      * Set mostrarTop
  297.      *
  298.      * @param boolean $mostrarTop
  299.      * @return DivisaIdioma
  300.      */
  301.     public function getMostrarTop()
  302.     {
  303.         return $this->mostrarTop;
  304.     }
  305.     /**
  306.      * Get mostrarTop
  307.      *
  308.      * @return mostrarTop 
  309.      */
  310.     public function setMostrarTop($mostrarTop)
  311.     {
  312.         $this->mostrarTop=$mostrarTop;
  313.         return $this;
  314.     }
  315.     /**
  316.      * Set mostrarFoot
  317.      *
  318.      * @return DivisaIdioma
  319.      */
  320.     public function getMostrarFoot()
  321.     {
  322.         return $this->mostrarFoot;
  323.     }
  324.     /**
  325.      * Get mostrarTop
  326.      * 
  327.      * @param boolean $mostrarFoot
  328.      * @return mostrarTop 
  329.      */
  330.     public function setMostrarFoot($mostrarFoot)
  331.     {
  332.         $this->mostrarFoot=$mostrarFoot;
  333.         return $this;
  334.     }
  335.     /**
  336.      * Get altBanner
  337.      *
  338.      * @return string
  339.      */
  340.     public function getAltBanner(){
  341.         return $this->altBanner;
  342.     }
  343.     /**
  344.      * Set altBanner
  345.      * @param string $altBanner
  346.      * @return DivisaIdioma
  347.      */
  348.     public function setAltBanner($altBanner){
  349.         $this->altBanner $altBanner;
  350.         return $this;
  351.     }
  352.     public function isMostrarTop(): ?bool
  353.     {
  354.         return $this->mostrarTop;
  355.     }
  356.     public function isMostrarFoot(): ?bool
  357.     {
  358.         return $this->mostrarFoot;
  359.     }
  360.     public function getSlug(): ?string
  361.     {
  362.         return $this->slug;
  363.     }
  364.     public function setSlug(?string $slug): self
  365.     {
  366.         $this->slug $slug;
  367.         return $this;
  368.     }
  369. }