mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-01 04:23:49 +00:00
sf4 deprecated: migrate Doctrine ORM mapping to annotation
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user