/** * 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; }
public function add(GroupInterface $group) { $this->groups[$group->getName()] = $group; }