Public Member Functions | |
| ilCourseWaitingList ($a_course_id) | |
| getCourseId () | |
| addToList ($a_usr_id) | |
| removeFromList ($a_usr_id) | |
| isOnList ($a_usr_id) | |
| getCountUsers () | |
| getPosition ($a_usr_id) | |
| getAllUsers () | |
| getUser ($a_usr_id) | |
| __read () | |
| _deleteAll ($a_course_id) | |
| _deleteUser ($a_usr_id) | |
Data Fields | |
| $db = null | |
| $course_id = 0 | |
Definition at line 35 of file class.ilCourseWaitingList.php.
| ilCourseWaitingList::__read | ( | ) |
Definition at line 112 of file class.ilCourseWaitingList.php.
References $counter, $query, $res, and $row.
Referenced by addToList(), ilCourseWaitingList(), and removeFromList().
{
$this->users = array();
$query = "SELECT * FROM crs_waiting_list ".
"WHERE obj_id = '".$this->getCourseId()."' ORDER BY sub_time";
$res = $this->db->query($query);
$counter = 0;
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
++$counter;
$this->users[$row->usr_id]['position'] = $counter;
$this->users[$row->usr_id]['time'] = $row->sub_time;
$this->users[$row->usr_id]['usr_id'] = $row->usr_id;
}
return true;
}
Here is the caller graph for this function:| ilCourseWaitingList::_deleteAll | ( | $ | a_course_id | ) |
Definition at line 133 of file class.ilCourseWaitingList.php.
References $query.
| ilCourseWaitingList::_deleteUser | ( | $ | a_usr_id | ) |
Definition at line 142 of file class.ilCourseWaitingList.php.
References $query.
| ilCourseWaitingList::addToList | ( | $ | a_usr_id | ) |
Definition at line 57 of file class.ilCourseWaitingList.php.
References $query, __read(), and isOnList().
{
if($this->isOnList($a_usr_id))
{
return false;
}
$query = "INSERT INTO crs_waiting_list ".
"SET obj_id = '".$this->getCourseId()."', ".
"usr_id = '".$a_usr_id."', ".
"sub_time = '".time()."'";
$this->db->query($query);
$this->__read();
return false;
}
Here is the call graph for this function:| ilCourseWaitingList::getAllUsers | ( | ) |
Definition at line 100 of file class.ilCourseWaitingList.php.
{
return $this->users ? $this->users : array();
}
| ilCourseWaitingList::getCountUsers | ( | ) |
Definition at line 90 of file class.ilCourseWaitingList.php.
{
return count($this->users);
}
| ilCourseWaitingList::getCourseId | ( | ) |
Definition at line 52 of file class.ilCourseWaitingList.php.
{
return $this->course_id;
}
| ilCourseWaitingList::getPosition | ( | $ | a_usr_id | ) |
Definition at line 95 of file class.ilCourseWaitingList.php.
{
return isset($this->users[$a_usr_id]) ? $this->users[$a_usr_id]['position'] : -1;
}
| ilCourseWaitingList::getUser | ( | $ | a_usr_id | ) |
Definition at line 105 of file class.ilCourseWaitingList.php.
{
return isset($this->users[$a_usr_id]) ? $this->users[$a_usr_id] : false;
}
| ilCourseWaitingList::ilCourseWaitingList | ( | $ | a_course_id | ) |
Definition at line 42 of file class.ilCourseWaitingList.php.
References __read().
{
global $ilDB;
$this->db = $ilDB;
$this->course_id = $a_course_id;
$this->__read();
}
Here is the call graph for this function:| ilCourseWaitingList::isOnList | ( | $ | a_usr_id | ) |
Definition at line 85 of file class.ilCourseWaitingList.php.
Referenced by addToList().
{
return isset($this->users[$a_usr_id]) ? true : false;
}
Here is the caller graph for this function:| ilCourseWaitingList::removeFromList | ( | $ | a_usr_id | ) |
Definition at line 73 of file class.ilCourseWaitingList.php.
References $query, and __read().
{
$query = "DELETE FROM crs_waiting_list ".
" WHERE obj_id = '".$this->getCourseId()."' ".
" AND usr_id = '".$a_usr_id."'";
$this->db->query($query);
$this->__read();
return true;
}
Here is the call graph for this function:| ilCourseWaitingList::$course_id = 0 |
Definition at line 38 of file class.ilCourseWaitingList.php.
| ilCourseWaitingList::$db = null |
Definition at line 37 of file class.ilCourseWaitingList.php.
1.7.1