class ilobjcourse More...
Inheritance diagram for ilCourseWaitingList:
Collaboration diagram for ilCourseWaitingList:Public Member Functions | |
| ilCourseWaitingList ($a_course_id) | |
| getCourseId () | |
| addToList ($a_usr_id) | |
| updateSubscriptionTime ($a_usr_id, $a_subtime) | |
| removeFromList ($a_usr_id) | |
| isOnList ($a_usr_id) | |
| getCountUsers () | |
| getPosition ($a_usr_id) | |
| getAllUsers () | |
| getUser ($a_usr_id) | |
| getUserIds () | |
| Get all user ids of users on waiting list. | |
| __read () | |
| _deleteAll ($a_course_id) | |
| _deleteUser ($a_usr_id) | |
Private Attributes | |
| $db = null | |
| $course_id = 0 | |
| $user_ids = array() | |
class ilobjcourse
Definition at line 34 of file class.ilCourseWaitingList.php.
| ilCourseWaitingList::__read | ( | ) |
Definition at line 141 of file class.ilCourseWaitingList.php.
References $res, and getCourseId().
Referenced by addToList(), ilCourseWaitingList(), and removeFromList().
{
global $ilDB;
$this->users = array();
$query = "SELECT * FROM crs_waiting_list ".
"WHERE obj_id = ".$ilDB->quote($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;
$this->user_ids[] = $row->usr_id;
}
return true;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilCourseWaitingList::_deleteAll | ( | $ | a_course_id | ) |
Definition at line 165 of file class.ilCourseWaitingList.php.
Referenced by ilSoapCourseAdministration::updateCourse().
{
global $ilDB;
$query = "DELETE FROM crs_waiting_list WHERE obj_id = ".$ilDB->quote($a_course_id)." ";
$ilDB->query($query);
return true;
}
Here is the caller graph for this function:| ilCourseWaitingList::_deleteUser | ( | $ | a_usr_id | ) |
Definition at line 174 of file class.ilCourseWaitingList.php.
{
global $ilDB;
$query = "DELETE FROM crs_waiting_list WHERE usr_id = ".$ilDB->quote($a_usr_id)."";
$ilDB->query($query);
return true;
}
| ilCourseWaitingList::addToList | ( | $ | a_usr_id | ) |
Definition at line 57 of file class.ilCourseWaitingList.php.
References __read(), getCourseId(), and isOnList().
{
global $ilDB;
if($this->isOnList($a_usr_id))
{
return false;
}
$query = "INSERT INTO crs_waiting_list ".
"SET obj_id = ".$ilDB->quote($this->getCourseId()).", ".
"usr_id = ".$ilDB->quote($a_usr_id).", ".
"sub_time = ".$ilDB->quote(time())." ";
$this->db->query($query);
$this->__read();
return false;
}
Here is the call graph for this function:| ilCourseWaitingList::getAllUsers | ( | ) |
Definition at line 119 of file class.ilCourseWaitingList.php.
{
return $this->users ? $this->users : array();
}
| ilCourseWaitingList::getCountUsers | ( | ) |
Definition at line 109 of file class.ilCourseWaitingList.php.
{
return count($this->users);
}
| ilCourseWaitingList::getCourseId | ( | ) |
Definition at line 52 of file class.ilCourseWaitingList.php.
Referenced by __read(), addToList(), removeFromList(), and updateSubscriptionTime().
{
return $this->course_id;
}
Here is the caller graph for this function:| ilCourseWaitingList::getPosition | ( | $ | a_usr_id | ) |
Definition at line 114 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 124 of file class.ilCourseWaitingList.php.
{
return isset($this->users[$a_usr_id]) ? $this->users[$a_usr_id] : false;
}
| ilCourseWaitingList::getUserIds | ( | ) |
Get all user ids of users on waiting list.
Definition at line 134 of file class.ilCourseWaitingList.php.
{
return $this->user_ids ? $this->user_ids : array();
}
| 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 104 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 90 of file class.ilCourseWaitingList.php.
References __read(), and getCourseId().
{
global $ilDB;
$query = "DELETE FROM crs_waiting_list ".
" WHERE obj_id = ".$ilDB->quote($this->getCourseId())." ".
" AND usr_id = ".$ilDB->quote($a_usr_id)." ";
$this->db->query($query);
$this->__read();
return true;
}
Here is the call graph for this function:| ilCourseWaitingList::updateSubscriptionTime | ( | $ | a_usr_id, | |
| $ | a_subtime | |||
| ) |
Definition at line 76 of file class.ilCourseWaitingList.php.
References getCourseId().
{
global $ilDB;
$query = "UPDATE crs_waiting_list ".
"SET sub_time = ".$ilDB->quote($a_subtime)." ".
"WHERE usr_id = ".$ilDB->quote($a_usr_id)." ".
"AND obj_id = ".$ilDB->quote($this->getCourseId())." ";
$this->db->query($query);
return true;
}
Here is the call graph for this function:ilCourseWaitingList::$course_id = 0 [private] |
Definition at line 37 of file class.ilCourseWaitingList.php.
ilCourseWaitingList::$db = null [private] |
Definition at line 36 of file class.ilCourseWaitingList.php.
ilCourseWaitingList::$user_ids = array() [private] |
Definition at line 38 of file class.ilCourseWaitingList.php.
1.7.1