src/Aviatur/GeneralBundle/Entity/Metasearch.php line 18

Open in your IDE?
  1. <?php
  2. namespace Aviatur\GeneralBundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  5. /**
  6.  * metasearch.
  7.  *
  8.  * @ORM\Table(name="metasearch")
  9.  * @ORM\Entity(repositoryClass="Aviatur\GeneralBundle\Entity\MetasearchRepository")
  10.  * @UniqueEntity(
  11.  * fields={"url"},
  12.  * message="La url ya esta asignada."
  13.  * )
  14.  */
  15. class Metasearch
  16. {
  17.     /**
  18.      * @var int
  19.      *
  20.      * @ORM\Column(name="id", type="integer")
  21.      * @ORM\Id
  22.      * @ORM\GeneratedValue(strategy="AUTO")
  23.      */
  24.     private $id;
  25.     /**
  26.      * @var string
  27.      *
  28.      * @ORM\Column(name="name", type="string", length=50)
  29.      */
  30.     private $name;
  31.     /**
  32.      * @var string
  33.      *
  34.      * @ORM\Column(name="token", type="string", length=32)
  35.      */
  36.     private $token;
  37.     /**
  38.      * @var string
  39.      *
  40.      * @ORM\Column(name="url", type="string", length=50)
  41.      */
  42.     private $url;
  43.     /**
  44.      *
  45.      * @ORM\ManyToOne(targetEntity="Aviatur\AgencyBundle\Entity\Agency", inversedBy="metasearch")
  46.      * @ORM\JoinColumns({
  47.      *   @ORM\JoinColumn(name="agency_id", referencedColumnName="id")
  48.      * })
  49.      */
  50.     private ?\Aviatur\AgencyBundle\Entity\Agency $agency null;
  51.     /**
  52.      * @ORM\OneToMany(targetEntity="Aviatur\GeneralBundle\Entity\Metatransaction", mappedBy="metasearch", cascade={"all"})
  53.      */
  54.     private $Metatransaction;
  55.     public function __construct()
  56.     {
  57.         $this->Metatransaction = new \Doctrine\Common\Collections\ArrayCollection();
  58.     }
  59.     /**
  60.      * Get id.
  61.      *
  62.      * @return int
  63.      */
  64.     public function getId()
  65.     {
  66.         return $this->id;
  67.     }
  68.     /**
  69.      * Set name.
  70.      *
  71.      * @param string $name
  72.      *
  73.      * @return metasearch
  74.      */
  75.     public function setName($name)
  76.     {
  77.         $this->name $name;
  78.         return $this;
  79.     }
  80.     /**
  81.      * Get name.
  82.      *
  83.      * @return string
  84.      */
  85.     public function getName()
  86.     {
  87.         return $this->name;
  88.     }
  89.     /**
  90.      * Set token.
  91.      *
  92.      * @param string $token
  93.      *
  94.      * @return metasearch
  95.      */
  96.     public function setToken($token)
  97.     {
  98.         $this->token $token;
  99.         return $this;
  100.     }
  101.     /**
  102.      * Get token.
  103.      *
  104.      * @return string
  105.      */
  106.     public function getToken()
  107.     {
  108.         return $this->token;
  109.     }
  110.     /**
  111.      * Set url.
  112.      *
  113.      * @param string $url
  114.      *
  115.      * @return metasearch
  116.      */
  117.     public function setUrl($url)
  118.     {
  119.         $this->url $url;
  120.         return $this;
  121.     }
  122.     /**
  123.      * Get url.
  124.      *
  125.      * @return string
  126.      */
  127.     public function getUrl()
  128.     {
  129.         return $this->url;
  130.     }
  131.     /**
  132.      * Set agency.
  133.      *
  134.      * @param \Aviatur\AgencyBundle\Entity\Agency $agency
  135.      *
  136.      * @return metasearch
  137.      */
  138.     public function setAgency(\Aviatur\AgencyBundle\Entity\Agency $agency null)
  139.     {
  140.         $this->agency $agency;
  141.         return $this;
  142.     }
  143.     /**
  144.      * Get agency.
  145.      *
  146.      * @return \Aviatur\AgencyBundle\Entity\Agency
  147.      */
  148.     public function getAgency()
  149.     {
  150.         return $this->agency;
  151.     }
  152.     /**
  153.      * Add Metatransaction.
  154.      *
  155.      * @return Content
  156.      */
  157.     public function addMetatransaction(\Aviatur\GeneralBundle\Entity\Metatransaction $Metatransaction)
  158.     {
  159.         $this->MetaTransaction[] = $Metatransaction;
  160.         return $this;
  161.     }
  162.     /**
  163.      * Remove Metatransaction.
  164.      */
  165.     public function removeMetatransaction(\Aviatur\GeneralBundle\Entity\Metatransaction $Metatransaction)
  166.     {
  167.         $this->MetaTransaction->removeElement($Metatransaction);
  168.     }
  169.     /**
  170.      * Get Metatransaction.
  171.      *
  172.      * @return \Doctrine\Common\Collections\Collection
  173.      */
  174.     public function getMetatransaction()
  175.     {
  176.         return $this->Metatransaction;
  177.     }
  178. }