* * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ 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é */ class RoleScope { /** * @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 $role; /** * @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 * * @ORM\ManyToMany( * targetEntity="Chill\MainBundle\Entity\PermissionsGroup", * mappedBy="roleScopes") */ private $permissionsGroups; /** * RoleScope constructor. */ public function __construct() { $this->new = true; $this->permissionsGroups = new ArrayCollection(); } /** * @return int */ public function getId() { return $this->id; } /** * @return string */ public function getRole() { return $this->role; } /** * @return Scope */ public function getScope() { return $this->scope; } /** * @param type $role * @return RoleScope */ public function setRole($role) { $this->role = $role; return $this; } /** * @param Scope $scope * @return RoleScope */ public function setScope(Scope $scope = null) { $this->scope = $scope; return $this; } }