Пример #1
0
 /**
  * Add a user group to this collection.
  *
  * @param GroupInterface $group The user group to add
  *
  * @return GroupCollection      Returns $this for chainability
  *
  * @throws \InvalidArgumentException If a group with the same name has
  *                                   already been set on this collection
  */
 public function add(GroupInterface $group)
 {
     if (isset($this->_groups[$group->getName()])) {
         throw new \InvalidArgumentException(sprintf('User group `%s` is already defined', $group->getName()));
     }
     $this->_groups[$group->getName()] = $group;
     return $this;
 }
Пример #2
0
 public function add(GroupInterface $group)
 {
     $this->groups[$group->getName()] = $group;
 }