ninegate/src/ninegate-1.0/src/Cadoles/CoreBundle/Entity/Country.php

187 lines
3.4 KiB
PHP

<?php
namespace Cadoles\CoreBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity
* @ORM\Table(name="country")
* @ORM\HasLifecycleCallbacks()
*
*/
class Country
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(type="string", length=20)
*/
private $code;
/**
* @ORM\Column(type="string", length=250)
*/
private $label;
/**
* @var ArrayCollection $users
* @var User
*
* @ORM\OneToMany(targetEntity="User", mappedBy="birthcountry")
* @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
*/
private $users;
/**
* @var ArrayCollection $registrations
* @var User
*
* @ORM\OneToMany(targetEntity="Registration", mappedBy="birthcountry")
* @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
*/
private $registrations;
/**
* Constructor
*/
public function __construct()
{
$this->users = new \Doctrine\Common\Collections\ArrayCollection();
}
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set code
*
* @param string $code
*
* @return Country
*/
public function setCode($code)
{
$this->code = $code;
return $this;
}
/**
* Get code
*
* @return string
*/
public function getCode()
{
return $this->code;
}
/**
* Set label
*
* @param string $label
*
* @return Country
*/
public function setLabel($label)
{
$this->label = $label;
return $this;
}
/**
* Get label
*
* @return string
*/
public function getLabel()
{
return $this->label;
}
/**
* Add user
*
* @param \Cadoles\CoreBundle\Entity\User $user
*
* @return Country
*/
public function addUser(\Cadoles\CoreBundle\Entity\User $user)
{
$this->users[] = $user;
return $this;
}
/**
* Remove user
*
* @param \Cadoles\CoreBundle\Entity\User $user
*/
public function removeUser(\Cadoles\CoreBundle\Entity\User $user)
{
$this->users->removeElement($user);
}
/**
* Get users
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getUsers()
{
return $this->users;
}
/**
* Add registration
*
* @param \Cadoles\CoreBundle\Entity\Registration $registration
*
* @return Country
*/
public function addRegistration(\Cadoles\CoreBundle\Entity\Registration $registration)
{
$this->registrations[] = $registration;
return $this;
}
/**
* Remove registration
*
* @param \Cadoles\CoreBundle\Entity\Registration $registration
*/
public function removeRegistration(\Cadoles\CoreBundle\Entity\Registration $registration)
{
$this->registrations->removeElement($registration);
}
/**
* Get registrations
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getRegistrations()
{
return $this->registrations;
}
}