src/Entity/DivisaConversion.php line 21

  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Symfony\Component\Validator\Constraints as Assert;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  7. use Knp\DoctrineBehaviors\Contract\Entity\TranslatableInterface;
  8. use Knp\DoctrineBehaviors\Model\Translatable\TranslatableTrait;
  9. /**
  10.  * DivisaConversion
  11.  *
  12.  * @ORM\Table(name="divisa_conversion", uniqueConstraints={ 
  13.  *         @ORM\UniqueConstraint(name="par_divisas", columns={"divisaOrigen", "divisaDestino"})
  14.  * })
  15.  * @ORM\Entity(repositoryClass="App\Repository\DivisaConversionRepository")
  16.  */
  17. class DivisaConversion  implements TranslatableInterface
  18. {
  19.     use TranslatableTrait;
  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.     * @ORM\ManyToOne(targetEntity="Divisa")
  30.     * @ORM\JoinColumn(name="divisaOrigen", referencedColumnName="id", nullable=false)
  31.     */
  32.     private $divisaOrigen;
  33.     /**
  34.     * @ORM\ManyToOne(targetEntity="Divisa")
  35.     * @ORM\JoinColumn(name="divisaDestino", referencedColumnName="id", nullable=false)
  36.     */
  37.     private $divisaDestino;
  38.     /**
  39.      * @var integer
  40.      *
  41.      * @ORM\Column(name="visitas", type="integer")
  42.      */
  43.     private $visitas=0;
  44.     
  45.     public function __call($method$args)
  46.     {
  47.         //return $this->proxyCurrentLocaleTranslation($method, $arguments);
  48.         if (!method_exists(self::getTranslationEntityClass(), $method)) {
  49.             $method 'get'ucfirst($method);
  50.         }
  51.         return $this->proxyCurrentLocaleTranslation($method$args);        
  52.     }
  53.     public function __construct() {
  54.         $this->traducciones = new ArrayCollection();
  55.     }
  56.     /**
  57.      * Get id
  58.      *
  59.      * @return integer 
  60.      */
  61.     public function getId()
  62.     {
  63.         return $this->id;
  64.     }
  65.     /**
  66.      * Set divisaOrigen
  67.      *
  68.      * @param integer $divisaOrigen
  69.      * @return DivisaConversion
  70.      */
  71.     public function setDivisaOrigen($divisaOrigen)
  72.     {
  73.         $this->divisaOrigen $divisaOrigen;
  74.         return $this;
  75.     }
  76.     /**
  77.      * Get divisaOrigen
  78.      *
  79.      * @return integer 
  80.      */
  81.     public function getDivisaOrigen()
  82.     {
  83.         return $this->divisaOrigen;
  84.     }
  85.     /**
  86.      * Set divisaDestino
  87.      *
  88.      * @param integer $divisaDestino
  89.      * @return DivisaConversion
  90.      */
  91.     public function setDivisaDestino($divisaDestino)
  92.     {
  93.         $this->divisaDestino $divisaDestino;
  94.         return $this;
  95.     }
  96.     /**
  97.      * Get divisaDestino
  98.      *
  99.      * @return integer 
  100.      */
  101.     public function getDivisaDestino()
  102.     {
  103.         return $this->divisaDestino;
  104.     }
  105.     /**
  106.      * Set visitas
  107.      *
  108.      * @param integer $visitas
  109.      * @return DivisaConversion
  110.      */
  111.     public function setVisitas($visitas)
  112.     {
  113.         $this->visitas $visitas;
  114.         return $this;
  115.     }
  116.     /**
  117.      * Get visitas
  118.      *
  119.      * @return integer 
  120.      */
  121.     public function getVisitas()
  122.     {
  123.         return $this->visitas;
  124.     }
  125. }