src/Entity/Promocion.php line 18

  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. use Knp\DoctrineBehaviors\Contract\Entity\TranslatableInterface;
  7. use Knp\DoctrineBehaviors\Model\Translatable\TranslatableTrait;
  8. /**
  9.  * Promocion
  10.  *
  11.  * @ORM\Table("promocion")
  12.  * @ORM\Entity
  13.  */
  14. class Promocion implements TranslatableInterface
  15. {
  16.     use TranslatableTrait;
  17.     public function __toString() {
  18.         return $this->nombre;
  19.     }
  20.     /**
  21.      * @var integer
  22.      *
  23.      * @ORM\Column(name="id", type="integer")
  24.      * @ORM\Id
  25.      * @ORM\GeneratedValue(strategy="AUTO")
  26.      */
  27.     private $id;
  28.     
  29.     /**
  30.      * @var string
  31.      *
  32.      * @ORM\Column(name="empresa", type="string", length=255)
  33.      */
  34.     private $empresa;
  35.     
  36.     /**
  37.      * @var string
  38.      *
  39.      * @ORM\Column(name="nombre", type="string", length=255)
  40.      */
  41.     private $nombre;
  42.     /**
  43.      * @var boolean
  44.      *
  45.      * @ORM\Column(name="activa", type="boolean")
  46.      */
  47.     private $activa;
  48.     /**
  49.      * @var string
  50.      *
  51.      * @ORM\ManyToOne(targetEntity="Imagen") 
  52.      */
  53.     protected $imagen;      
  54.     
  55.     
  56.     public function __call($method$args)
  57.     {
  58.         //return $this->proxyCurrentLocaleTranslation($method, $arguments);
  59.         if (!method_exists(self::getTranslationEntityClass(), $method)) {
  60.             $method 'get'ucfirst($method);
  61.         }
  62.         return $this->proxyCurrentLocaleTranslation($method$args);        
  63.     }
  64.     /**
  65.      * Get id
  66.      *
  67.      * @return integer 
  68.      */
  69.     public function getId()
  70.     {
  71.         return $this->id;
  72.     }
  73.     /**
  74.      * Set activa
  75.      *
  76.      * @param boolean $activa
  77.      * @return Promocion
  78.      */
  79.     public function setActiva($activa)
  80.     {
  81.         $this->activa $activa;
  82.         return $this;
  83.     }
  84.     /**
  85.      * Get activa
  86.      *
  87.      * @return boolean 
  88.      */
  89.     public function getActiva()
  90.     {
  91.         return $this->activa;
  92.     }
  93.     /**
  94.      * Get traducciones
  95.      *
  96.      * @return string 
  97.      */
  98.     public function getTraducciones()
  99.     {
  100.         return $this->traducciones;
  101.     }
  102.     public function getEmpresa(): ?string
  103.     {
  104.         return $this->empresa;
  105.     }
  106.     public function setEmpresa(string $empresa): self
  107.     {
  108.         $this->empresa $empresa;
  109.         return $this;
  110.     }
  111.     public function isActiva(): ?bool
  112.     {
  113.         return $this->activa;
  114.     }
  115.     public function getImagen(): ?Imagen
  116.     {
  117.         return $this->imagen;
  118.     }
  119.     public function setImagen(?Imagen $imagen): self
  120.     {
  121.         $this->imagen $imagen;
  122.         return $this;
  123.     }
  124.     public function getNombre(): ?string
  125.     {
  126.         return $this->nombre;
  127.     }
  128.     public function setNombre(string $nombre): self
  129.     {
  130.         $this->nombre $nombre;
  131.         return $this;
  132.     }
  133. }