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,49 +20,73 @@
namespace Chill\MainBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\ArrayCollection;
/**
*
* @ORM\Entity()
* @ORM\Table(name="role_scopes")
* @ORM\Cache(usage="NONSTRICT_READ_WRITE", region="acl_cache_region")
*
* @author Julien Fastré <julien.fastre@champs-libres.coop>
*/
class RoleScope
{
/**
* @var integer
*
* @var int
* @ORM\Id
* @ORM\Column(name="id", type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
*
* @var string
*
* @ORM\Column(type="string", length=255)
*/
private $role;
/**
* @var Scope
*
* @var Scope
* @ORM\ManyToOne(
* targetEntity="Chill\MainBundle\Entity\Scope",
* inversedBy="roleScopes")
* @ORM\JoinColumn(nullable=true, name="scope_id")
* @ORM\Cache(usage="NONSTRICT_READ_WRITE")
*/
private $scope;
/**
* @var Collection
*
* @var \Doctrine\Common\Collections\Collection
* @ORM\ManyToMany(
* targetEntity="Chill\MainBundle\Entity\PermissionsGroup",
* mappedBy="roleScopes")
*/
private $permissionsGroups;
/**
* RoleScope constructor.
*/
public function __construct() {
$this->new = true;
$this->permissionsGroups = new \Doctrine\Common\Collections\ArrayCollection();
$this->permissionsGroups = new ArrayCollection();
}
/**
* @return int
*/
public function getId()
{
return $this->id;
}
/**
*
* @return string
*/
public function getRole()
@@ -71,7 +95,6 @@ class RoleScope
}
/**
*
* @return Scope
*/
public function getScope()
@@ -80,9 +103,8 @@ class RoleScope
}
/**
*
* @param type $role
* @return \Chill\MainBundle\Entity\RoleScope
* @return RoleScope
*/
public function setRole($role)
{
@@ -92,9 +114,8 @@ class RoleScope
}
/**
*
* @param \Chill\MainBundle\Entity\Scope $scope
* @return \Chill\MainBundle\Entity\RoleScope
* @param Scope $scope
* @return RoleScope
*/
public function setScope(Scope $scope = null)
{