Skip to content

Instantly share code, notes, and snippets.

@Rhincodon
Created January 17, 2018 13:56
Show Gist options
  • Save Rhincodon/afa15bdff16790db34ae6dd56fa0ac92 to your computer and use it in GitHub Desktop.
Save Rhincodon/afa15bdff16790db34ae6dd56fa0ac92 to your computer and use it in GitHub Desktop.
fear
<?php
namespace AppBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
/**
* SiteGroup
*
* @ORM\Table(name="site_group")
* @ORM\Entity(repositoryClass="AppBundle\Repository\SiteGroupRepository")
*/
class SiteGroup
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="name", type="string", length=255)
*/
private $name;
/**
* @var string
*
* @ORM\Column(name="description", type="text", nullable=true)
*/
private $description;
/**
* @ORM\ManyToMany(targetEntity="Site", inversedBy="siteGroup")
* @ORM\JoinColumn(name="site_group_id", referencedColumnName="id", unique=true)
*/
private $sites;
/**
* @ORM\ManyToOne(targetEntity="Language")
* @ORM\JoinColumn(onDelete="CASCADE")
*/
private $language;
/**
* @var boolean $detectLanguage
* @ORM\Column(name="detect_language", type="boolean", nullable=true)
*/
private $detectLanguage;
/**
* @ORM\OneToMany(targetEntity="Tou", mappedBy="siteGroup", cascade={"persist", "remove"}, orphanRemoval=true)
*/
protected $touLang;
/**
* @var int
*
* @ORM\Column(name="traffic_limit", type="integer")
*/
private $trafficLimit;
public function __toString()
{
return $this->name;
}
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set name
*
* @param string $name
* @return SiteGroup
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Get name
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Set description
*
* @param string $description
* @return SiteGroup
*/
public function setDescription($description)
{
$this->description = $description;
return $this;
}
/**
* Get description
*
* @return string
*/
public function getDescription()
{
return $this->description;
}
/**
* Set detectLanguage
*
* @param boolean $detectLanguage
* @return SiteGroup
*/
public function setDetectLanguage($detectLanguage)
{
$this->detectLanguage = $detectLanguage;
return $this;
}
/**
* Get detectLanguage
*
* @return boolean
*/
public function getDetectLanguage()
{
return $this->detectLanguage;
}
/**
* Set language
*
* @param \AppBundle\Entity\Language $language
* @return SiteGroup
*/
public function setLanguage(\AppBundle\Entity\Language $language = null)
{
$this->language = $language;
return $this;
}
/**
* Get language
*
* @return \AppBundle\Entity\Language
*/
public function getLanguage()
{
return $this->language;
}
/**
* Set sites
*
* @param \AppBundle\Entity\Site $sites
* @return SiteGroup
*/
public function setSites(\AppBundle\Entity\Site $sites = null)
{
$this->sites = $sites;
return $this;
}
/**
* Get sites
*
* @return \AppBundle\Entity\Site
*/
public function getSites()
{
return $this->sites;
}
/**
* Constructor
*/
public function __construct()
{
$this->sites = new \Doctrine\Common\Collections\ArrayCollection();
}
/**
* Add sites
*
* @param \AppBundle\Entity\Site $sites
* @return SiteGroup
*/
public function addSite(\AppBundle\Entity\Site $sites)
{
$this->sites[] = $sites;
return $this;
}
/**
* Remove sites
*
* @param \AppBundle\Entity\Site $sites
*/
public function removeSite(\AppBundle\Entity\Site $sites)
{
$this->sites->removeElement($sites);
}
/**
* Add touLang
*
* @param \AppBundle\Entity\Tou $touLang
* @return SiteGroup
*/
public function addTouLang(\AppBundle\Entity\Tou $touLang)
{
$this->touLang[] = $touLang;
return $this;
}
/**
* Remove touLang
*
* @param \AppBundle\Entity\Tou $touLang
*/
public function removeTouLang(\AppBundle\Entity\Tou $touLang)
{
$this->touLang->removeElement($touLang);
}
/**
* Get touLang
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getTouLang()
{
return $this->touLang;
}
/**
* Set trafficLimit
*
* @param integer $trafficLimit
* @return SiteGroup
*/
public function setTrafficLimit($trafficLimit)
{
$this->trafficLimit = $trafficLimit;
return $this;
}
/**
* Get trafficLimit
*
* @return integer
*/
public function getTrafficLimit()
{
return $this->trafficLimit;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment