/** * Save a group. * @param \vakata\user\GroupInterface $group the group to save * @return self */ public function saveGroup(GroupInterface $group) : UserManagementInterface { if (!isset($this->groups[$group->getID()])) { $this->groups[$group->getID()] = $group; } $this->permissions = array_values(array_unique(array_merge($this->permissions, $group->getPermissions()))); return $this; }