src/Entity/DivisaTranslation.php line 20
- <?php
- namespace App\Entity;
- use Doctrine\DBAL\Types\Types;
- use Doctrine\ORM\Mapping as ORM;
- use Knp\DoctrineBehaviors\Contract\Entity\TranslationInterface;
- use Knp\DoctrineBehaviors\Model\Translatable\TranslationTrait;
- use Knp\DoctrineBehaviors\Model\Sluggable\SluggableTrait;
- use Knp\DoctrineBehaviors\Contract\Entity\SluggableInterface;
- /**
- * DivisaIdioma
- *
- * @ORM\Table(name="divisa_translation")
- * @ORM\Entity
- */
- class DivisaTranslation implements TranslationInterface//, SluggableInterface
- {
- use TranslationTrait;
- // use SluggableTrait;
- /**
- * @var integer
- *
- * @ORM\Column(name="id", type="integer")
- * @ORM\Id
- * @ORM\GeneratedValue(strategy="AUTO")
- */
- private $id;
- /**
- * @var string
- *
- * @ORM\Column(name="altBanner", type="string", length=255, nullable=true)
- *
- */
- private $altBanner;
- /**
- * ORM\ManyToOne(targetEntity="App\Entity\Divisa", inversedBy="traducciones")
- * ORM\JoinColumn(name="divisa", referencedColumnName="id", onDelete="cascade")
- */
- // private $divisa;
- /**
- * @var string
- *
- * @ORM\Column(name="nombre", type="string", length=255)
- */
- private $nombre;
- /**
- * @var string
- *
- * @ORM\Column(name="texto1", type="text")
- */
- private $texto1;
- /**
- * @var string
- *
- * @ORM\Column(name="texto2", type="text")
- */
- private $texto2;
- /**
- * @var string
- *
- * @ORM\Column(name="meta_keywords", type="string", length=255, nullable=true)
- */
- private $metaKeywords = "";
- /**
- * @var string
- *
- * @ORM\Column(name="meta_description", type="string", length=255, nullable=true)
- */
- private $metaDescription = "";
- /**
- * @var string
- *
- * @ORM\Column(name="meta_title", type="string", length=255, nullable=true)
- */
- private $metaTitle = "";
- /**
- * @var string
- *
- * @ORM\Column(name="nombrebanco", type="string", length=1000, nullable=true)
- */
- private $nombrebanco;
- /**
- * @var boolean
- *
- * @ORM\Column(name="mostrarTop", type="boolean", nullable=true)
- */
- private $mostrarTop;
- /**
- * @var boolean
- *
- * @ORM\Column(name="mostrarFoot", type="boolean", nullable=true)
- */
- private $mostrarFoot;
- /**
- * @var string
- *
- * @ORM\Column(name="slug", type="string", length=255, nullable=true)
- */
- private $slug;
- public function getSluggableFields(): array
- {
- return ['nombre'];
- }
- /**
- * Get id
- *
- * @return integer
- */
- public function getId()
- {
- return $this->id;
- }
- /**
- * Set divisa
- *
- * @param Divisa $divisa
- * @return DivisaIdioma
- */
- // public function setDivisa(Divisa $divisa)
- // {
- // $this->divisa = $divisa;
- //
- // return $this;
- // }
- /**
- * Get divisa
- *
- * @return Divisa
- */
- // public function getDivisa()
- // {
- // return $this->divisa;
- // }
- /**
- * Set nombre
- *
- * @param string $nombre
- * @return DivisaIdioma
- */
- public function setNombre($nombre)
- {
- $this->nombre = $nombre;
- return $this;
- }
- /**
- * Get nombre
- *
- * @return string
- */
- public function getNombre()
- {
- return $this->nombre;
- }
- /**
- * Set texto1
- *
- * @param string $texto1
- * @return DivisaIdioma
- */
- public function setTexto1($texto1)
- {
- $this->texto1 = $texto1;
- return $this;
- }
- /**
- * Get texto1
- *
- * @return string
- */
- public function getTexto1()
- {
- return $this->texto1;
- }
- /**
- * Set texto2
- *
- * @param string $texto2
- * @return DivisaIdioma
- */
- public function setTexto2($texto2)
- {
- $this->texto2 = $texto2;
- return $this;
- }
- /**
- * Get texto2
- *
- * @return string
- */
- public function getTexto2()
- {
- return $this->texto2;
- }
- /**
- * Set nombrebanco
- *
- * @param string $nombrebanco
- * @return nombreBanco
- */
- public function setNombrebanco($nombrebanco)
- {
- $this->nombrebanco = $nombrebanco;
- return $this;
- }
- /**
- * Get nombrebanco
- *
- * @return string
- */
- public function getNombrebanco()
- {
- return $this->nombrebanco;
- }
- static private function slugify($text)
- {
- // replace non letter or digits by -
- $text = preg_replace('~[^\\pL\d]+~u', '-', $text);
- // trim
- $text = trim($text, '-');
- // transliterate
- $text = iconv('utf-8', 'us-ascii//TRANSLIT', $text);
- // lowercase
- $text = strtolower($text);
- // remove unwanted characters
- $text = preg_replace('~[^-\w]+~', '', $text);
- if (empty($text))
- {
- return 'n-a';
- }
- return $text;
- }
- /**
- * Set metaKeywords
- *
- * @param string $metaKeywords
- * @return Entrada
- */
- public function setMetaKeywords($metaKeywords)
- {
- $this->metaKeywords = $metaKeywords;
- return $this;
- }
- /**
- * Get metaKeywords
- *
- * @return string
- */
- public function getMetaKeywords()
- {
- return $this->metaKeywords;
- }
- /**
- * Set metaDescription
- *
- * @param string $metaDescription
- * @return Entrada
- */
- public function setMetaDescription($metaDescription)
- {
- $this->metaDescription = $metaDescription;
- return $this;
- }
- /**
- * Get metaDescription
- *
- * @return string
- */
- public function getMetaDescription()
- {
- return $this->metaDescription;
- }
- /**
- * Set metaTitle
- *
- * @param string $metaTitle
- * @return Entrada
- */
- public function setMetaTitle($metaTitle)
- {
- $this->metaTitle = $metaTitle;
- return $this;
- }
- /**
- * Get metaTitle
- *
- * @return string
- */
- public function getMetaTitle()
- {
- return $this->metaTitle;
- }
- /**
- * Set mostrarTop
- *
- * @param boolean $mostrarTop
- * @return DivisaIdioma
- */
- public function getMostrarTop()
- {
- return $this->mostrarTop;
- }
- /**
- * Get mostrarTop
- *
- * @return mostrarTop
- */
- public function setMostrarTop($mostrarTop)
- {
- $this->mostrarTop=$mostrarTop;
- return $this;
- }
- /**
- * Set mostrarFoot
- *
- * @return DivisaIdioma
- */
- public function getMostrarFoot()
- {
- return $this->mostrarFoot;
- }
- /**
- * Get mostrarTop
- *
- * @param boolean $mostrarFoot
- * @return mostrarTop
- */
- public function setMostrarFoot($mostrarFoot)
- {
- $this->mostrarFoot=$mostrarFoot;
- return $this;
- }
- /**
- * Get altBanner
- *
- * @return string
- */
- public function getAltBanner(){
- return $this->altBanner;
- }
- /**
- * Set altBanner
- * @param string $altBanner
- * @return DivisaIdioma
- */
- public function setAltBanner($altBanner){
- $this->altBanner = $altBanner;
- return $this;
- }
- public function isMostrarTop(): ?bool
- {
- return $this->mostrarTop;
- }
- public function isMostrarFoot(): ?bool
- {
- return $this->mostrarFoot;
- }
- public function getSlug(): ?string
- {
- return $this->slug;
- }
- public function setSlug(?string $slug): self
- {
- $this->slug = $slug;
- return $this;
- }
- }