src/Aviatur/FlightBundle/Entity/ConfigFlightAgency.php line 14

Open in your IDE?
  1. <?php
  2. namespace Aviatur\FlightBundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * ConfigFlightAgency.
  6.  *
  7.  * @ORM\Table(name="config_flight_agency", indexes={@ORM\Index(name="agency_id", columns={"agency_id"}), @ORM\Index(name="provider_id", columns={"provider_id"})})
  8.  * @ORM\Entity(repositoryClass="Aviatur\FlightBundle\Entity\ConfigFlightAgencyRepository")
  9.  * @ORM\HasLifecycleCallbacks
  10.  */
  11. class ConfigFlightAgency
  12. {
  13.     /**
  14.      * @var int
  15.      *
  16.      * @ORM\Column(name="id", type="integer", nullable=false)
  17.      * @ORM\Id
  18.      * @ORM\GeneratedValue(strategy="IDENTITY")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @var string
  23.      *
  24.      * @ORM\Column(name="wsUrl", type="string", length=255, nullable=false)
  25.      */
  26.     private $wsurl;
  27.     /**
  28.      * @var string
  29.      *
  30.      * @ORM\Column(name="message", type="string", length=255, nullable=false)
  31.      */
  32.     private $message;
  33.     /**
  34.      * @var string
  35.      *
  36.      * @ORM\Column(name="officeId", type="string", length=255, nullable=false)
  37.      */
  38.     private $officeid;
  39.     /**
  40.      * @var string
  41.      *
  42.      * @ORM\Column(name="externalId", type="string", length=255, nullable=false)
  43.      */
  44.     private $externalid;
  45.     /**
  46.      * @var int
  47.      *
  48.      * @ORM\Column(name="preference", type="integer", nullable=true)
  49.      */
  50.     private $preference 1;
  51.     /**
  52.      * @var bool
  53.      *
  54.      * @ORM\Column(name="isActive", type="boolean", nullable=false)
  55.      */
  56.     private $isactive;
  57.      /**
  58.      * @var bool
  59.      *
  60.      * @ORM\Column(name="activeFF", type="boolean", nullable=false)
  61.      */
  62.     private $activeFF;
  63.     /**
  64.      * @var int
  65.      *
  66.      * @ORM\Column(name="maxTime", type="integer", nullable=false)
  67.      */
  68.     private $maxtime 0;
  69.     /**
  70.      * @var bool
  71.      *
  72.      * @ORM\Column(name="hasCombination", type="boolean", nullable=false)
  73.      */
  74.     private $hascombination;
  75.     /**
  76.      * @var int
  77.      *
  78.      * @ORM\Column(name="errorCount", type="integer", nullable=true)
  79.      */
  80.     private $errorcount 0;
  81.     /**
  82.      * @ORM\Column(name="errorDatetime", type="datetime", nullable=true)
  83.      */
  84.     private ?\DateTime $errordatetime null;
  85.     /**
  86.      *
  87.      * @ORM\ManyToOne(targetEntity="Aviatur\MpaBundle\Entity\Provider", inversedBy="configFlightAgency")
  88.      * @ORM\JoinColumns({
  89.      *   @ORM\JoinColumn(name="provider_id", referencedColumnName="id")
  90.      * })
  91.      */
  92.     private ?\Aviatur\MpaBundle\Entity\Provider $provider null;
  93.     /**
  94.      *
  95.      * @ORM\ManyToOne(targetEntity="Aviatur\AgencyBundle\Entity\Agency", inversedBy="configFlightAgency")
  96.      * @ORM\JoinColumns({
  97.      *   @ORM\JoinColumn(name="agency_id", referencedColumnName="id")
  98.      * })
  99.      */
  100.     private ?\Aviatur\AgencyBundle\Entity\Agency $agency null;
  101.     /**
  102.      * Get id.
  103.      *
  104.      * @return int
  105.      */
  106.     public function getId()
  107.     {
  108.         return $this->id;
  109.     }
  110.     /**
  111.      * Set wsurl.
  112.      *
  113.      * @param string $wsurl
  114.      *
  115.      * @return ConfigFlightAgency
  116.      */
  117.     public function setWsurl($wsurl)
  118.     {
  119.         $this->wsurl $wsurl;
  120.         return $this;
  121.     }
  122.     /**
  123.      * Get wsurl.
  124.      *
  125.      * @return string
  126.      */
  127.     public function getWsurl()
  128.     {
  129.         return $this->wsurl;
  130.     }
  131.     /**
  132.      * Set message.
  133.      *
  134.      * @param string $message
  135.      *
  136.      * @return ConfigFlightAgency
  137.      */
  138.     public function setMessage($message)
  139.     {
  140.         $this->message $message;
  141.         return $this;
  142.     }
  143.     /**
  144.      * Get message.
  145.      *
  146.      * @return string
  147.      */
  148.     public function getMessage()
  149.     {
  150.         return $this->message;
  151.     }
  152.     /**
  153.      * Set officeid.
  154.      *
  155.      * @param string $officeid
  156.      *
  157.      * @return ConfigFlightAgency
  158.      */
  159.     public function setOfficeid($officeid)
  160.     {
  161.         $this->officeid $officeid;
  162.         return $this;
  163.     }
  164.     /**
  165.      * Get officeid.
  166.      *
  167.      * @return string
  168.      */
  169.     public function getOfficeid()
  170.     {
  171.         return $this->officeid;
  172.     }
  173.     /**
  174.      * Set externalid.
  175.      *
  176.      * @param string $externalid
  177.      *
  178.      * @return ConfigFlightAgency
  179.      */
  180.     public function setExternalid($externalid)
  181.     {
  182.         $this->externalid $externalid;
  183.         return $this;
  184.     }
  185.     /**
  186.      * Get externalid.
  187.      *
  188.      * @return string
  189.      */
  190.     public function getExternalid()
  191.     {
  192.         return $this->externalid;
  193.     }
  194.     /**
  195.      * Set preference.
  196.      *
  197.      * @param bool $preference
  198.      *
  199.      * @return ConfigFlightAgency
  200.      */
  201.     public function setPreference($preference)
  202.     {
  203.         $this->preference $preference;
  204.         return $this;
  205.     }
  206.     /**
  207.      * Get preference.
  208.      *
  209.      * @return bool
  210.      */
  211.     public function getPreference()
  212.     {
  213.         return $this->preference;
  214.     }
  215.     /**
  216.      * Set isactive.
  217.      *
  218.      * @param bool $isactive
  219.      *
  220.      * @return ConfigFlightAgency
  221.      */
  222.     public function setIsactive($isactive)
  223.     {
  224.         $this->isactive $isactive;
  225.         return $this;
  226.     }
  227.     /**
  228.      * Get isactive.
  229.      *
  230.      * @return bool
  231.      */
  232.     public function getIsactive()
  233.     {
  234.         return $this->isactive;
  235.     }
  236.     /**
  237.      * Set activeFF.
  238.      *
  239.      * @param bool $activeFF
  240.      *
  241.      * @return ConfigFlightAgency
  242.      */
  243.     public function setActiveFF($activeFF)
  244.     {
  245.         $this->activeFF $activeFF;
  246.         return $this;
  247.     }
  248.     /**
  249.      * Get activeFF.
  250.      *
  251.      * @return bool
  252.      */
  253.     public function getActiveFF()
  254.     {
  255.         return $this->activeFF;
  256.     }
  257.     /**
  258.      * Set hascombination.
  259.      *
  260.      * @param bool $hascombination
  261.      *
  262.      * @return ConfigFlightAgency
  263.      */
  264.     public function setHascombination($hascombination)
  265.     {
  266.         $this->hascombination $hascombination;
  267.         return $this;
  268.     }
  269.     /**
  270.      * Get hascombination.
  271.      *
  272.      * @return bool
  273.      */
  274.     public function getHascombination()
  275.     {
  276.         return $this->hascombination;
  277.     }
  278.     /**
  279.      * Set maxtime.
  280.      *
  281.      * @param int $maxtime
  282.      *
  283.      * @return ConfigFlightAgency
  284.      */
  285.     public function setMaxtime($maxtime)
  286.     {
  287.         $this->maxtime $maxtime;
  288.         return $this;
  289.     }
  290.     /**
  291.      * Get maxtime.
  292.      *
  293.      * @return int
  294.      */
  295.     public function getMaxtime()
  296.     {
  297.         return $this->maxtime;
  298.     }
  299.     /**
  300.      * Set provider.
  301.      *
  302.      * @param \Aviatur\MpaBundle\Entity\Provider $provider
  303.      *
  304.      * @return ConfigFlightAgency
  305.      */
  306.     public function setProvider(\Aviatur\MpaBundle\Entity\Provider $provider null)
  307.     {
  308.         $this->provider $provider;
  309.         return $this;
  310.     }
  311.     /**
  312.      * Get provider.
  313.      *
  314.      * @return \Aviatur\MpaBundle\Entity\Provider
  315.      */
  316.     public function getProvider()
  317.     {
  318.         return $this->provider;
  319.     }
  320.     /**
  321.      * Set agency.
  322.      *
  323.      * @param \Aviatur\AgencyBundle\Entity\Agency $agency
  324.      *
  325.      * @return ConfigFlightAgency
  326.      */
  327.     public function setAgency(\Aviatur\AgencyBundle\Entity\Agency $agency null)
  328.     {
  329.         $this->agency $agency;
  330.         return $this;
  331.     }
  332.     /**
  333.      * Get agency.
  334.      *
  335.      * @return \Aviatur\AgencyBundle\Entity\Agency
  336.      */
  337.     public function getAgency()
  338.     {
  339.         return $this->agency;
  340.     }
  341.     /**
  342.      * Set errorcount.
  343.      *
  344.      * @param int $errorcount
  345.      *
  346.      * @return ConfigFlightAgency
  347.      */
  348.     public function setErrorcount($errorcount)
  349.     {
  350.         $this->errorcount $errorcount;
  351.         return $this;
  352.     }
  353.     /**
  354.      * Get errorcount.
  355.      *
  356.      * @return int
  357.      */
  358.     public function getErrorcount()
  359.     {
  360.         return $this->errorcount;
  361.     }
  362.     /**
  363.      * Set errordatetime.
  364.      *
  365.      * @return ConfigFlightAgency
  366.      */
  367.     public function setErrordatetime(\DateTime $errordatetime)
  368.     {
  369.         $this->errordatetime $errordatetime;
  370.         return $this;
  371.     }
  372.     /**
  373.      * Get errordatetime.
  374.      *
  375.      * @return \DateTime|null
  376.      */
  377.     public function getErrordatetime()
  378.     {
  379.         return $this->errordatetime;
  380.     }
  381.     public function __toString()
  382.     {
  383.         return (string) $this->getAgency();
  384.     }
  385.         /**
  386.      * @ORM\PrePersist
  387.      */
  388.     public function validatePersist(\Doctrine\ORM\Event\LifecycleEventArgs $args)
  389.     {
  390.         if (isset($this->errordatetime) || empty($this->errordatetime)) {
  391.             $this->errordatetime = new \DateTime('0001-01-01');
  392.         }
  393.          if (isset($this->maxtime) || empty($this->maxtime)) {
  394.             $this->maxtime 0;
  395.         }
  396.         return true;
  397.     }
  398. }