<?php
namespace Platform\SecurityBundle\Entity\Identity;
use App\Entity\Shared\AliasableInterface;
use App\Entity\Shared\AliasableTrait;
use Cms\CoreBundle\Model\Interfaces\Fixable\FixableInterface;
use Cms\CoreBundle\Model\Interfaces\Fixable\FixableTrait;
use Cms\CoreBundle\Model\Interfaces\OneRosterable\OneRosterableInterface;
use Cms\CoreBundle\Model\Interfaces\OneRosterable\OneRosterableTrait;
use Platform\SecurityBundle\Entity\Access\RoleAssociation\GroupRoleAssociation;
use Cms\TenantBundle\Entity\TenantedEntity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
/**
* Class Group
* @package Platform\SecurityBundle\Entity\Identity
*
* @ORM\Entity(
* repositoryClass = "Platform\SecurityBundle\Doctrine\Identity\GroupRepository"
* )
* @ORM\Table(
* name = "cms__security__identity__group",
* uniqueConstraints = {
* @ORM\UniqueConstraint(
* name = "uidx__unique__group",
* columns = {
* "tenant",
* "name"
* }
* ),
* }
* )
*/
class Group extends TenantedEntity
implements
OneRosterableInterface,
FixableInterface,
AliasableInterface
{
use OneRosterableTrait;
use FixableTrait;
use AliasableTrait;
/**
* @var string
*
* @ORM\Column(
* type = "string",
* nullable = false
* )
*/
protected $name;
/**
* @var ArrayCollection|GroupRoleAssociation[]
*
* @ORM\OneToMany(
* targetEntity = "Platform\SecurityBundle\Entity\Access\RoleAssociation\GroupRoleAssociation",
* mappedBy = "group"
* )
*/
protected $roles;
/**
*
*/
public function __construct()
{
$this->roles = new ArrayCollection();
}
/**
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* @return ArrayCollection|GroupRoleAssociation[]
*/
public function getRoles()
{
return $this->roles;
}
/**
* @param string $value
* @return $this
*/
public function setName($value)
{
$this->name = $value;
return $this;
}
}