<?php
namespace Aviatur\FlightBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* ConfigFlightAgency.
*
* @ORM\Table(name="config_flight_agency", indexes={@ORM\Index(name="agency_id", columns={"agency_id"}), @ORM\Index(name="provider_id", columns={"provider_id"})})
* @ORM\Entity(repositoryClass="Aviatur\FlightBundle\Entity\ConfigFlightAgencyRepository")
* @ORM\HasLifecycleCallbacks
*/
class ConfigFlightAgency
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer", nullable=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="wsUrl", type="string", length=255, nullable=false)
*/
private $wsurl;
/**
* @var string
*
* @ORM\Column(name="message", type="string", length=255, nullable=false)
*/
private $message;
/**
* @var string
*
* @ORM\Column(name="officeId", type="string", length=255, nullable=false)
*/
private $officeid;
/**
* @var string
*
* @ORM\Column(name="externalId", type="string", length=255, nullable=false)
*/
private $externalid;
/**
* @var int
*
* @ORM\Column(name="preference", type="integer", nullable=true)
*/
private $preference = 1;
/**
* @var bool
*
* @ORM\Column(name="isActive", type="boolean", nullable=false)
*/
private $isactive;
/**
* @var bool
*
* @ORM\Column(name="activeFF", type="boolean", nullable=false)
*/
private $activeFF;
/**
* @var int
*
* @ORM\Column(name="maxTime", type="integer", nullable=false)
*/
private $maxtime = 0;
/**
* @var bool
*
* @ORM\Column(name="hasCombination", type="boolean", nullable=false)
*/
private $hascombination;
/**
* @var int
*
* @ORM\Column(name="errorCount", type="integer", nullable=true)
*/
private $errorcount = 0;
/**
* @ORM\Column(name="errorDatetime", type="datetime", nullable=true)
*/
private ?\DateTime $errordatetime = null;
/**
*
* @ORM\ManyToOne(targetEntity="Aviatur\MpaBundle\Entity\Provider", inversedBy="configFlightAgency")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="provider_id", referencedColumnName="id")
* })
*/
private ?\Aviatur\MpaBundle\Entity\Provider $provider = null;
/**
*
* @ORM\ManyToOne(targetEntity="Aviatur\AgencyBundle\Entity\Agency", inversedBy="configFlightAgency")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="agency_id", referencedColumnName="id")
* })
*/
private ?\Aviatur\AgencyBundle\Entity\Agency $agency = null;
/**
* Get id.
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set wsurl.
*
* @param string $wsurl
*
* @return ConfigFlightAgency
*/
public function setWsurl($wsurl)
{
$this->wsurl = $wsurl;
return $this;
}
/**
* Get wsurl.
*
* @return string
*/
public function getWsurl()
{
return $this->wsurl;
}
/**
* Set message.
*
* @param string $message
*
* @return ConfigFlightAgency
*/
public function setMessage($message)
{
$this->message = $message;
return $this;
}
/**
* Get message.
*
* @return string
*/
public function getMessage()
{
return $this->message;
}
/**
* Set officeid.
*
* @param string $officeid
*
* @return ConfigFlightAgency
*/
public function setOfficeid($officeid)
{
$this->officeid = $officeid;
return $this;
}
/**
* Get officeid.
*
* @return string
*/
public function getOfficeid()
{
return $this->officeid;
}
/**
* Set externalid.
*
* @param string $externalid
*
* @return ConfigFlightAgency
*/
public function setExternalid($externalid)
{
$this->externalid = $externalid;
return $this;
}
/**
* Get externalid.
*
* @return string
*/
public function getExternalid()
{
return $this->externalid;
}
/**
* Set preference.
*
* @param bool $preference
*
* @return ConfigFlightAgency
*/
public function setPreference($preference)
{
$this->preference = $preference;
return $this;
}
/**
* Get preference.
*
* @return bool
*/
public function getPreference()
{
return $this->preference;
}
/**
* Set isactive.
*
* @param bool $isactive
*
* @return ConfigFlightAgency
*/
public function setIsactive($isactive)
{
$this->isactive = $isactive;
return $this;
}
/**
* Get isactive.
*
* @return bool
*/
public function getIsactive()
{
return $this->isactive;
}
/**
* Set activeFF.
*
* @param bool $activeFF
*
* @return ConfigFlightAgency
*/
public function setActiveFF($activeFF)
{
$this->activeFF = $activeFF;
return $this;
}
/**
* Get activeFF.
*
* @return bool
*/
public function getActiveFF()
{
return $this->activeFF;
}
/**
* Set hascombination.
*
* @param bool $hascombination
*
* @return ConfigFlightAgency
*/
public function setHascombination($hascombination)
{
$this->hascombination = $hascombination;
return $this;
}
/**
* Get hascombination.
*
* @return bool
*/
public function getHascombination()
{
return $this->hascombination;
}
/**
* Set maxtime.
*
* @param int $maxtime
*
* @return ConfigFlightAgency
*/
public function setMaxtime($maxtime)
{
$this->maxtime = $maxtime;
return $this;
}
/**
* Get maxtime.
*
* @return int
*/
public function getMaxtime()
{
return $this->maxtime;
}
/**
* Set provider.
*
* @param \Aviatur\MpaBundle\Entity\Provider $provider
*
* @return ConfigFlightAgency
*/
public function setProvider(\Aviatur\MpaBundle\Entity\Provider $provider = null)
{
$this->provider = $provider;
return $this;
}
/**
* Get provider.
*
* @return \Aviatur\MpaBundle\Entity\Provider
*/
public function getProvider()
{
return $this->provider;
}
/**
* Set agency.
*
* @param \Aviatur\AgencyBundle\Entity\Agency $agency
*
* @return ConfigFlightAgency
*/
public function setAgency(\Aviatur\AgencyBundle\Entity\Agency $agency = null)
{
$this->agency = $agency;
return $this;
}
/**
* Get agency.
*
* @return \Aviatur\AgencyBundle\Entity\Agency
*/
public function getAgency()
{
return $this->agency;
}
/**
* Set errorcount.
*
* @param int $errorcount
*
* @return ConfigFlightAgency
*/
public function setErrorcount($errorcount)
{
$this->errorcount = $errorcount;
return $this;
}
/**
* Get errorcount.
*
* @return int
*/
public function getErrorcount()
{
return $this->errorcount;
}
/**
* Set errordatetime.
*
* @return ConfigFlightAgency
*/
public function setErrordatetime(\DateTime $errordatetime)
{
$this->errordatetime = $errordatetime;
return $this;
}
/**
* Get errordatetime.
*
* @return \DateTime|null
*/
public function getErrordatetime()
{
return $this->errordatetime;
}
public function __toString()
{
return (string) $this->getAgency();
}
/**
* @ORM\PrePersist
*/
public function validatePersist(\Doctrine\ORM\Event\LifecycleEventArgs $args)
{
if (isset($this->errordatetime) || empty($this->errordatetime)) {
$this->errordatetime = new \DateTime('0001-01-01');
}
if (isset($this->maxtime) || empty($this->maxtime)) {
$this->maxtime = 0;
}
return true;
}
}