Public Member Functions | Data Fields

ilTimingPlaned Class Reference

class ilTimingPlaned More...

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 <smeyer@databay.de>
Version:
Id:
class.ilTimingPlaned.php 13197 2007-02-05 11:43:22Z smeyer

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


Member Function Documentation

ilTimingPlaned::__read (  ) 

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

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

Referenced by ilTimingPlaned().

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

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 116 of file class.ilTimingPlaned.php.

References $ilDB.

Referenced by delete(), and update().

        {
                global $ilDB;

                $query = "DELETE FROM crs_timings_planed ".
                        "WHERE item_id = ".$ilDB->quote($a_item_id)." ".
                        "AND usr_id = ".$ilDB->quote($a_usr_id)." ";
                $ilDB->query($query);
        }

Here is the caller graph for this function:

ilTimingPlaned::_deleteByItem ( a_item_id  ) 

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

References $ilDB.

        {
                global $ilDB;

                $query = "DELETE FROM crs_timings_planed ".
                        "WHERE item_id = ".$ilDB->quote($a_item_id)." ";
                $ilDB->query($query);
        }

ilTimingPlaned::_deleteByUser ( a_usr_id  ) 

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

References $ilDB.

        {
                global $ilDB;

                $query = "DELETE FROM crs_timings_planed ".
                        "WHERE usr_id = ".$ilDB->quote($a_usr_id)." ";
                $ilDB->query($query);
        }

ilTimingPlaned::_getPlanedTimings ( a_usr_id,
a_item_id 
)

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

References $data, $ilDB, and $res.

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

        {
                global $ilDB;

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

Here is the caller graph for this function:

ilTimingPlaned::_getPlanedTimingsByItem ( a_item_id  ) 

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

References $data, $ilDB, and $res.

Referenced by ilTimingCache::_getTimings().

        {
                global $ilDB;

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

Here is the caller graph for this function:

ilTimingPlaned::create (  ) 

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

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

Referenced by update().

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

Here is the call graph for this function:

Here is the caller graph for this function:

ilTimingPlaned::delete (  ) 

Definition at line 111 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().

        {
                $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().

        {
                ilTimingPlaned::_delete($this->getItemId(),$this->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::$ilDB
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: