This method is the constructor for the learnpathList. It gets a list of available learning paths from the database and creates the learnpath objects. This list depends on the user that is connected (only displays) items if he has enough permissions to view them.
Parameters:
integer
$user_id
User ID
string
$course_code
Optional course code (otherwise we use api_get_course_id())