Public Member Functions | Data Fields

ilTimingPlaned Class Reference

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

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


Member Function Documentation

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;
        }               

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, and $query.

Referenced by delete(), and update().

        {
                global $ilDB;

                $query = "DELETE FROM crs_timings_planed ".
                        "WHERE item_id = '".$a_item_id."' ".
                        "AND usr_id = '".$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, and $query.

        {
                global $ilDB;

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

ilTimingPlaned::_deleteByUser ( a_usr_id  ) 

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

References $ilDB, and $query.

        {
                global $ilDB;

                $query = "DELETE FROM crs_timings_planed ".
                        "WHERE usr_id = '".$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, $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();
        }

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, $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();
        }

Here is the caller graph for this function:

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);
        }

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

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

        {
                return $this->item_id;
        }

Here is the caller graph for this function:

ilTimingPlaned::getPlanedEndingTime (  ) 

Definition at line 73 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 65 of file class.ilTimingPlaned.php.

Referenced by create().

        {
                return $this->start;
        }

Here is the caller graph for this function:

ilTimingPlaned::getUserId (  ) 

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

Referenced by 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 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();
        }

Here is the call graph for this function:

ilTimingPlaned::setPlanedEndingTime ( a_end  ) 

Definition at line 77 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 69 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 94 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 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;
        }

Here is the call graph for this function:


Field Documentation

ilTimingPlaned::$ilDB
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().


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