public function add_userlist(userlist_base $userlist) : userlist_collection {
        $component = $userlist->get_component();
        if (isset($this->userlists[$component])) {
            throw new \moodle_exception("A userlist has already been added for the '{$component}' component");
        }

        $this->userlists[$component] = $userlist;

        return $this;
    }
public function add_userlist(userlist_base $userlist) : userlist_collection {
        $component = $userlist->get_component();
        if (isset($this->userlists[$component])) {
            throw new \moodle_exception("A userlist has already been added for the '{$component}' component");
        }

        $this->userlists[$component] = $userlist;

        return $this;
    }
public function add_userlist ( userlist_base $ userlist ) : userlist_collection { $ component = $ userlist -> get_component ( ) ; if ( isset ( $ this -> userlists [ $ component ] ) ) { throw new \ moodle_exception ( "A userlist has already been added for the '{$component}' component" ) ; } $ this -> userlists [ $ component ] = $ userlist ; return $ this ; }
Add a userlist to this collection.

@param   userlist_base $userlist the userlist to export.
@return  $this
Add a userlist to this collection .