ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilTimingPlaned Class Reference

class ilTimingPlaned More...

+ Collaboration diagram for ilTimingPlaned:

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

Detailed Description

class ilTimingPlaned

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
Id:
class.ilTimingPlaned.php 23143 2010-03-09 12:15:33Z smeyer

Definition at line 34 of file class.ilTimingPlaned.php.

Member Function Documentation

ilTimingPlaned::__read ( )

Definition at line 179 of file class.ilTimingPlaned.php.

References $ilDB, $query, $res, $row, DB_FETCHMODE_OBJECT, getItemId(), getUserId(), setPlanedEndingTime(), and setPlanedStartingTime().

Referenced by ilTimingPlaned().

{
global $ilDB;
$query = "SELECT * FROM crs_timings_planed ".
"WHERE item_id = ".$ilDB->quote($this->getItemId() ,'integer')." ".
"AND usr_id = ".$ilDB->quote($this->getUserId() ,'integer')." ";
$res = $this->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->setPlanedStartingTime($row->planed_start);
$this->setPlanedEndingTime($row->planed_end);
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTimingPlaned::_delete (   $a_item_id,
  $a_usr_id 
)

Definition at line 118 of file class.ilTimingPlaned.php.

References $ilDB, $query, and $res.

Referenced by delete(), and update().

{
global $ilDB;
$query = "DELETE FROM crs_timings_planed ".
"WHERE item_id = ".$ilDB->quote($a_item_id ,'integer')." ".
"AND usr_id = ".$ilDB->quote($a_usr_id ,'integer')." ";
$res = $ilDB->manipulate($query);
}

+ Here is the caller graph for this function:

ilTimingPlaned::_deleteByItem (   $a_item_id)

Definition at line 161 of file class.ilTimingPlaned.php.

References $ilDB, $query, and $res.

{
global $ilDB;
$query = "DELETE FROM crs_timings_planed ".
"WHERE item_id = ".$ilDB->quote($a_item_id ,'integer')." ";
$res = $ilDB->manipulate($query);
}
ilTimingPlaned::_deleteByUser (   $a_usr_id)

Definition at line 170 of file class.ilTimingPlaned.php.

References $ilDB, $query, and $res.

{
global $ilDB;
$query = "DELETE FROM crs_timings_planed ".
"WHERE usr_id = ".$ilDB->quote($a_usr_id ,'integer')." ";
$res = $ilDB->manipulate($query);
}
ilTimingPlaned::_getPlanedTimings (   $a_usr_id,
  $a_item_id 
)

Definition at line 129 of file class.ilTimingPlaned.php.

References $data, $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilCourseItems\__getItemData(), and ilCourseItems\_getItem().

{
global $ilDB;
$query = "SELECT * FROM crs_timings_planed ".
"WHERE item_id = ".$ilDB->quote($a_item_id ,'integer')." ".
"AND usr_id = ".$ilDB->quote($a_usr_id ,'integer')." ";
$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();
}

+ Here is the caller graph for this function:

ilTimingPlaned::_getPlanedTimingsByItem (   $a_item_id)

Definition at line 146 of file class.ilTimingPlaned.php.

References $data, $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilTimingCache\_getTimings().

{
global $ilDB;
$query = "SELECT * FROM crs_timings_planed ".
"WHERE item_id = ".$ilDB->quote($a_item_id ,'integer')." ";
$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();
}

+ Here is the caller graph for this function:

ilTimingPlaned::create ( )

Definition at line 99 of file class.ilTimingPlaned.php.

References $ilDB, $query, $res, getItemId(), getPlanedEndingTime(), getPlanedStartingTime(), and getUserId().

Referenced by update().

{
global $ilDB;
$query = "INSERT INTO crs_timings_planed (item_id,usr_id,planed_start,planed_end) ".
"VALUES( ".
$ilDB->quote($this->getItemId() ,'integer').", ".
$ilDB->quote($this->getUserId() ,'integer').", ".
$ilDB->quote($this->getPlanedStartingTime() ,'integer').", ".
$ilDB->quote($this->getPlanedEndingTime() ,'integer')." ".
")";
$res = $ilDB->manipulate($query);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTimingPlaned::delete ( )

Definition at line 113 of file class.ilTimingPlaned.php.

References _delete(), getItemId(), and getUserId().

{
return ilTimingPlaned::_delete($this->getItemId(),$this->getUserId());
}

+ Here is the call graph for this function:

ilTimingPlaned::getItemId ( )

Definition at line 58 of file class.ilTimingPlaned.php.

Referenced by __read(), create(), delete(), update(), and validate().

{
return $this->item_id;
}

+ Here is the caller graph for this function:

ilTimingPlaned::getPlanedEndingTime ( )

Definition at line 71 of file class.ilTimingPlaned.php.

Referenced by create(), and validate().

{
return $this->end;
}

+ Here is the caller graph for this function:

ilTimingPlaned::getPlanedStartingTime ( )

Definition at line 63 of file class.ilTimingPlaned.php.

Referenced by create().

{
return $this->start;
}

+ Here is the caller graph for this function:

ilTimingPlaned::getUserId ( )

Definition at line 54 of file class.ilTimingPlaned.php.

Referenced by __read(), create(), delete(), and update().

{
return $this->user_id;
}

+ Here is the caller graph for this function:

ilTimingPlaned::ilTimingPlaned (   $item_id,
  $a_usr_id 
)

Definition at line 40 of file class.ilTimingPlaned.php.

References $ilDB, $ilErr, $lng, 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();
}

+ Here is the call graph for this function:

ilTimingPlaned::setPlanedEndingTime (   $a_end)

Definition at line 75 of file class.ilTimingPlaned.php.

Referenced by __read().

{
$this->end = $a_end;
}

+ Here is the caller graph for this function:

ilTimingPlaned::setPlanedStartingTime (   $a_time)

Definition at line 67 of file class.ilTimingPlaned.php.

Referenced by __read(), and ilCourseContentGUI\updateUserTimings().

{
$this->start = $a_time;
}

+ Here is the caller graph for this function:

ilTimingPlaned::update ( )

Definition at line 92 of file class.ilTimingPlaned.php.

References _delete(), create(), getItemId(), and getUserId().

{
$this->create();
return true;
}

+ Here is the call graph for this function:

ilTimingPlaned::validate ( )

Definition at line 80 of file class.ilTimingPlaned.php.

References ilCourseItems\_getItem(), getItemId(), and getPlanedEndingTime().

{
include_once 'Modules/Course/classes/class.ilCourseItems.php';
$item_data = ilCourseItems::_getItem($this->getItemId());
if($this->getPlanedEndingTime() > $item_data['latest_end'])
{
return false;
}
return true;
}

+ Here is the call graph for this function:

Field Documentation

ilTimingPlaned::$ilErr

Definition at line 36 of file class.ilTimingPlaned.php.

Referenced by ilTimingPlaned().

ilTimingPlaned::$lng

Definition at line 38 of file class.ilTimingPlaned.php.

Referenced by ilTimingPlaned().


The documentation for this class was generated from the following file: