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,55 +20,80 @@
namespace Chill\MainBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Chill\MainBundle\Entity\Center;
use Chill\MainBundle\Entity\PermissionsGroup;
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\ArrayCollection;
/**
*
* @ORM\Entity()
* @ORM\Table(name="group_centers")
* @ORM\Cache(usage="NONSTRICT_READ_WRITE", region="acl_cache_region")
*
* @author Julien Fastré <julien.fastre@champs-libres.coop>
*/
class GroupCenter
{
/**
*
* @var int
*
* @ORM\Id
* @ORM\Column(name="id", type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
*
* @var Center
*
* @ORM\ManyToOne(
* targetEntity="Chill\MainBundle\Entity\Center",
* inversedBy="groupCenters"
* )
* @ORM\Cache(usage="NONSTRICT_READ_WRITE")
*/
private $center;
/**
* @var Collection
*
* @var Collection
* @ORM\ManyToMany(
* targetEntity="Chill\MainBundle\Entity\User",
* mappedBy="groupCenters"
* )
*/
private $users;
/**
*
* @var PermissionsGroup
*
* @ORM\ManyToOne(
* targetEntity="Chill\MainBundle\Entity\PermissionsGroup",
* inversedBy="groupCenters")
* @ORM\Cache(usage="NONSTRICT_READ_WRITE")
*/
private $permissionsGroup;
/**
* GroupCenter constructor.
*/
public function __construct()
{
$this->permissionsGroup = new ArrayCollection();
$this->users = new ArrayCollection();
}
/**
* @return int
*/
public function getId()
{
return $this->id;
}
/**
*
* @return Center
*/
public function getCenter()
@@ -77,7 +102,6 @@ class GroupCenter
}
/**
*
* @param Center $center
* @return \Chill\MainBundle\Entity\GroupCenter
*/
@@ -87,13 +111,15 @@ class GroupCenter
return $this;
}
/**
* @return ArrayCollection|Collection
*/
public function getUsers()
{
return $this->users;
}
/**
*
* @return PermissionGroup
*/
public function getPermissionsGroup()
@@ -102,7 +128,6 @@ class GroupCenter
}
/**
*
* @param \Chill\MainBundle\Entity\PermissionsGroup $permissionGroup
* @return \Chill\MainBundle\Entity\GroupCenter
*/