Public Member Functions | |
ilTimingPlaned ($item_id, $a_usr_id) | |
getUserId () | |
getItemId () | |
getPlanedStartingTime () | |
setPlanedStartingTime ($a_time) | |
getPlanedEndingTime () | |
setPlanedEndingTime ($a_end) | |
validate () | |
update () | |
create () | |
delete () | |
_delete ($a_item_id, $a_usr_id) | |
_getPlanedTimings ($a_usr_id, $a_item_id) | |
_getPlanedTimingsByItem ($a_item_id) | |
_deleteByItem ($a_item_id) | |
_deleteByUser ($a_usr_id) | |
__read () | |
Data Fields | |
$ilErr | |
$ilDB | |
$lng |
Definition at line 36 of file class.ilTimingPlaned.php.
ilTimingPlaned::__read | ( | ) |
Definition at line 177 of file class.ilTimingPlaned.php.
References $query, $res, $row, setPlanedEndingTime(), and setPlanedStartingTime().
Referenced by ilTimingPlaned().
{ $query = "SELECT * FROM crs_timings_planed ". "WHERE item_id = '".$this->getItemId()."' ". "AND usr_id = '".$this->getUserId()."'"; $res = $this->db->query($query); while($row = $res->fetchRow(DB_FETCHMODE_OBJECT)) { $this->setPlanedStartingTime($row->planed_start); $this->setPlanedEndingTime($row->planed_end); } return true; }
ilTimingPlaned::_delete | ( | $ | a_item_id, | |
$ | a_usr_id | |||
) |
ilTimingPlaned::_deleteByItem | ( | $ | a_item_id | ) |
ilTimingPlaned::_deleteByUser | ( | $ | a_usr_id | ) |
ilTimingPlaned::_getPlanedTimings | ( | $ | a_usr_id, | |
$ | a_item_id | |||
) |
Definition at line 127 of file class.ilTimingPlaned.php.
References $data, $ilDB, $query, $res, and $row.
Referenced by ilCourseItems::__getItemData(), and ilCourseItems::_getItem().
{ global $ilDB; $query = "SELECT * FROM crs_timings_planed ". "WHERE item_id = '".$a_item_id."' ". "AND usr_id = '".$a_usr_id."'"; $res = $ilDB->query($query); while($row = $res->fetchRow(DB_FETCHMODE_OBJECT)) { $data['planed_start'] = $row->planed_start; $data['planed_end'] = $row->planed_end; } return $data ? $data : array(); }
ilTimingPlaned::_getPlanedTimingsByItem | ( | $ | a_item_id | ) |
Definition at line 144 of file class.ilTimingPlaned.php.
References $data, $ilDB, $query, $res, and $row.
Referenced by ilTimingCache::_getTimings().
{ global $ilDB; $query = "SELECT * FROM crs_timings_planed ". "WHERE item_id = '".$a_item_id."'"; $res = $ilDB->query($query); while($row = $res->fetchRow(DB_FETCHMODE_OBJECT)) { $data[$row->usr_id]['start'] = $row->planed_start; $data[$row->usr_id]['end'] = $row->planed_end; } return $data ? $data : array(); }
ilTimingPlaned::create | ( | ) |
Definition at line 101 of file class.ilTimingPlaned.php.
References $query, getPlanedEndingTime(), and getPlanedStartingTime().
Referenced by update().
{ $query = "INSERT INTO crs_timings_planed ". "SET item_id = '".$this->getItemId()."', ". "usr_id = '".$this->getUserId()."', ". "planed_start = '".(int) $this->getPlanedStartingTime()."', ". "planed_end = '".(int) $this->getPlanedEndingTime()."'"; $this->db->query($query); }
ilTimingPlaned::delete | ( | ) |
Definition at line 111 of file class.ilTimingPlaned.php.
References _delete(), getItemId(), and getUserId().
{ return ilTimingPlaned::_delete($this->getItemId(),$this->getUserId()); }
ilTimingPlaned::getItemId | ( | ) |
Definition at line 60 of file class.ilTimingPlaned.php.
Referenced by delete(), update(), and validate().
{
return $this->item_id;
}
ilTimingPlaned::getPlanedEndingTime | ( | ) |
Definition at line 73 of file class.ilTimingPlaned.php.
Referenced by create(), and validate().
{
return $this->end;
}
ilTimingPlaned::getPlanedStartingTime | ( | ) |
Definition at line 65 of file class.ilTimingPlaned.php.
Referenced by create().
{
return $this->start;
}
ilTimingPlaned::getUserId | ( | ) |
Definition at line 56 of file class.ilTimingPlaned.php.
Referenced by delete(), and update().
{
return $this->user_id;
}
ilTimingPlaned::ilTimingPlaned | ( | $ | item_id, | |
$ | a_usr_id | |||
) |
Definition at line 42 of file class.ilTimingPlaned.php.
References $ilDB, $ilErr, $lng, $tree, and __read().
{ global $ilErr,$ilDB,$lng,$tree; $this->ilErr =& $ilErr; $this->db =& $ilDB; $this->lng =& $lng; $this->item_id = $item_id; $this->user_id = $a_usr_id; $this->__read(); }
ilTimingPlaned::setPlanedEndingTime | ( | $ | a_end | ) |
Definition at line 77 of file class.ilTimingPlaned.php.
Referenced by __read().
{ $this->end = $a_end; }
ilTimingPlaned::setPlanedStartingTime | ( | $ | a_time | ) |
Definition at line 69 of file class.ilTimingPlaned.php.
Referenced by __read().
{ $this->start = $a_time; }
ilTimingPlaned::update | ( | ) |
Definition at line 94 of file class.ilTimingPlaned.php.
References _delete(), create(), getItemId(), and getUserId().
{ ilTimingPlaned::_delete($this->getItemId(),$this->getUserId()); $this->create(); return true; }
ilTimingPlaned::validate | ( | ) |
Definition at line 82 of file class.ilTimingPlaned.php.
References ilCourseItems::_getItem(), getItemId(), and getPlanedEndingTime().
{ include_once 'course/classes/class.ilCourseItems.php'; $item_data = ilCourseItems::_getItem($this->getItemId()); if($this->getPlanedEndingTime() > $item_data['latest_end']) { return false; } return true; }
ilTimingPlaned::$ilDB |
Definition at line 39 of file class.ilTimingPlaned.php.
Referenced by _delete(), _deleteByItem(), _deleteByUser(), _getPlanedTimings(), _getPlanedTimingsByItem(), and ilTimingPlaned().
ilTimingPlaned::$ilErr |
Definition at line 38 of file class.ilTimingPlaned.php.
Referenced by ilTimingPlaned().
ilTimingPlaned::$lng |
Definition at line 40 of file class.ilTimingPlaned.php.
Referenced by ilTimingPlaned().