src/Platform/SecurityBundle/Entity/Identity/Group.php line 36

Open in your IDE?
  1. <?php
  2. namespace Platform\SecurityBundle\Entity\Identity;
  3. use App\Entity\Shared\AliasableInterface;
  4. use App\Entity\Shared\AliasableTrait;
  5. use Cms\CoreBundle\Model\Interfaces\Fixable\FixableInterface;
  6. use Cms\CoreBundle\Model\Interfaces\Fixable\FixableTrait;
  7. use Cms\CoreBundle\Model\Interfaces\OneRosterable\OneRosterableInterface;
  8. use Cms\CoreBundle\Model\Interfaces\OneRosterable\OneRosterableTrait;
  9. use Platform\SecurityBundle\Entity\Access\RoleAssociation\GroupRoleAssociation;
  10. use Cms\TenantBundle\Entity\TenantedEntity;
  11. use Doctrine\Common\Collections\ArrayCollection;
  12. use Doctrine\ORM\Mapping as ORM;
  13. /**
  14.  * Class Group
  15.  * @package Platform\SecurityBundle\Entity\Identity
  16.  *
  17.  * @ORM\Entity(
  18.  *  repositoryClass = "Platform\SecurityBundle\Doctrine\Identity\GroupRepository"
  19.  * )
  20.  * @ORM\Table(
  21.  *  name = "cms__security__identity__group",
  22.  *      uniqueConstraints = {
  23.  *          @ORM\UniqueConstraint(
  24.  *              name = "uidx__unique__group",
  25.  *              columns = {
  26.  *                  "tenant",
  27.  *                  "name"
  28.  *              }
  29.  *          ),
  30.  *      }
  31.  * )
  32.  */
  33. class Group extends TenantedEntity
  34.     implements
  35.         OneRosterableInterface,
  36.         FixableInterface,
  37.         AliasableInterface
  38. {
  39.     use OneRosterableTrait;
  40.     use FixableTrait;
  41.     use AliasableTrait;
  42.     /**
  43.      * @var string
  44.      *
  45.      * @ORM\Column(
  46.      *  type = "string",
  47.      *  nullable = false
  48.      * )
  49.      */
  50.     protected $name;
  51.     /**
  52.      * @var ArrayCollection|GroupRoleAssociation[]
  53.      *
  54.      * @ORM\OneToMany(
  55.      *  targetEntity = "Platform\SecurityBundle\Entity\Access\RoleAssociation\GroupRoleAssociation",
  56.      *  mappedBy = "group"
  57.      * )
  58.      */
  59.     protected $roles;
  60.     /**
  61.      *
  62.      */
  63.     public function __construct()
  64.     {
  65.         $this->roles = new ArrayCollection();
  66.     }
  67.     /**
  68.      * @return string
  69.      */
  70.     public function getName()
  71.     {
  72.         return $this->name;
  73.     }
  74.     /**
  75.      * @return ArrayCollection|GroupRoleAssociation[]
  76.      */
  77.     public function getRoles()
  78.     {
  79.         return $this->roles;
  80.     }
  81.     /**
  82.      * @param string $value
  83.      * @return $this
  84.      */
  85.     public function setName($value)
  86.     {
  87.         $this->name $value;
  88.         return $this;
  89.     }
  90. }