sf4 deprecated: migrate Doctrine ORM mapping to annotation

This commit is contained in:
2020-07-24 14:51:34 +02:00
parent 3033be78d2
commit 2746d3e003
20 changed files with 434 additions and 410 deletions

View File

@@ -20,68 +20,109 @@
namespace Chill\MainBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
/**
*
* @ORM\Entity(repositoryClass="Chill\MainBundle\Repository\CenterRepository")
* @ORM\Table(name="centers")
*
* @author Julien Fastré <julien.fastre@champs-libres.coop>
*/
class Center implements HasCenterInterface
{
/**
* @var integer
*
* @ORM\Id
* @ORM\Column(name="id", type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string
*
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @var Collection
*
* @var int
*/
private $id;
/**
*
* @var \Doctrine\Common\Collections\Collection
* @ORM\OneToMany(
* targetEntity="Chill\MainBundle\Entity\GroupCenter",
* mappedBy="center"
* )
*/
private $groupCenters;
/**
* Center constructor.
*/
public function __construct()
{
$this->groupCenters = new \Doctrine\Common\Collections\ArrayCollection();
}
/**
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* @param $name
* @return $this
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* @return ArrayCollection|Collection
*/
public function getGroupCenters()
{
return $this->groupCenters;
}
/**
* @param GroupCenter $groupCenter
* @return $this
*/
public function addGroupCenter(GroupCenter $groupCenter)
{
$this->groupCenters->add($groupCenter);
return $this;
}
/**
* @return string
*/
public function __toString()
{
return $this->getName();
}
/**
* @return $this|Center
*/
public function getCenter()
{
return $this;