Public Member Functions | Static Public Member Functions | Data Fields | Protected Attributes

ilObjRemoteCourse Class Reference

Inheritance diagram for ilObjRemoteCourse:
Collaboration diagram for ilObjRemoteCourse:

Public Member Functions

 __construct ($a_id=0, $a_call_by_reference=true)
 Constructor.
 getLocalInformation ()
 get local information
 setLocalInformation ($a_info)
 set local information
 setAvailabilityType ($a_type)
 Set Availability type.
 getAvailabilityType ()
 get availability type
 setStartingTime ($a_time)
 set starting time
 getStartingTime ()
 getStartingTime
 setEndingTime ($a_time)
 set ending time
 getEndingTime ()
 get ending time
 update ()
 Update function.
 delete ()
 Delete this remote course.
 read ($a_force_db=false)
 read settings

Static Public Member Functions

static _lookupOnline ($a_obj_id)
 Lookup online.

Data Fields

const ACTIVATION_OFFLINE = 0
const ACTIVATION_UNLIMITED = 1
const ACTIVATION_LIMITED = 2

Protected Attributes

 $availability_type
 $end
 $start
 $local_information

Detailed Description

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


Constructor & Destructor Documentation

ilObjRemoteCourse::__construct ( a_id = 0,
a_call_by_reference = true 
)

Constructor.

public

Definition at line 51 of file class.ilObjRemoteCourse.php.

References ilObject::ilObject().

        {
                global $ilDB;
                
                $this->type = "rcrs";
                $this->ilObject($a_id,$a_call_by_reference);
                $this->db = $ilDB;
        }

Here is the call graph for this function:


Member Function Documentation

static ilObjRemoteCourse::_lookupOnline ( a_obj_id  )  [static]

Lookup online.

public

Parameters:
int obj_id

Definition at line 68 of file class.ilObjRemoteCourse.php.

References $res.

Referenced by ilObjRemoteCourseListGUI::getProperties().

        {
                global $ilDB;
                
                $query = "SELECT * FROM remote_course_settings ".
                        "WHERE obj_id = ".$ilDB->quote($a_obj_id)." ";
                $res = $ilDB->query($query);
                $row = $res->fetchRow(DB_FETCHMODE_OBJECT);
                switch($row->availability_type)
                {
                        case self::ACTIVATION_UNLIMITED:
                                return true;
                                
                        case self::ACTIVATION_OFFLINE:
                                return false;
                                
                        case self::ACTIVATION_LIMITED:
                                return time() > $row->start && time < $row->end;
                                
                        default:
                                return false;
                }
                
                return false;
        }

Here is the caller graph for this function:

ilObjRemoteCourse::delete (  ) 

Delete this remote course.

public

Reimplemented from ilObject.

Definition at line 220 of file class.ilObjRemoteCourse.php.

        {
                if(!parent::delete())
                {
                        return false;
                }
                
                //put here your module specific stuff
                
                return true;
        }

ilObjRemoteCourse::getAvailabilityType (  ) 

get availability type

public

Definition at line 135 of file class.ilObjRemoteCourse.php.

Referenced by update().

        {
                return $this->availability_type;
        }

Here is the caller graph for this function:

ilObjRemoteCourse::getEndingTime (  ) 

get ending time

public

Parameters:
 

Definition at line 183 of file class.ilObjRemoteCourse.php.

Referenced by update().

        {
                return $this->end;
        }

Here is the caller graph for this function:

ilObjRemoteCourse::getLocalInformation (  ) 

get local information

public

Definition at line 100 of file class.ilObjRemoteCourse.php.

Referenced by update().

        {
                return $this->local_information;
        }

Here is the caller graph for this function:

ilObjRemoteCourse::getStartingTime (  ) 

getStartingTime

public

Parameters:
 

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

Referenced by update().

        {
                return $this->start;
        }

Here is the caller graph for this function:

ilObjRemoteCourse::read ( a_force_db = false  ) 

read settings

public

Parameters:
 

Reimplemented from ilObject.

Definition at line 239 of file class.ilObjRemoteCourse.php.

References $res, ilObject::getId(), setAvailabilityType(), setEndingTime(), setLocalInformation(), and setStartingTime().

        {
                parent::read($a_force_db);

                $query = "SELECT * FROM remote_course_settings ".
                        "WHERE obj_id = ".$this->db->quote($this->getId())." ";
                $res = $this->db->query($query);
                while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
                {
                        $this->setLocalInformation($row->local_information);
                        $this->setAvailabilityType($row->availability_type);
                        $this->setStartingTime($row->start);
                        $this->setEndingTime($row->end);
                }
        }

Here is the call graph for this function:

ilObjRemoteCourse::setAvailabilityType ( a_type  ) 

Set Availability type.

public

Parameters:
int availability type

Definition at line 124 of file class.ilObjRemoteCourse.php.

Referenced by read().

        {
                $this->availability_type = $a_type;
        }

Here is the caller graph for this function:

ilObjRemoteCourse::setEndingTime ( a_time  ) 

set ending time

public

Parameters:
int statrting time

Definition at line 171 of file class.ilObjRemoteCourse.php.

Referenced by read().

        {
                $this->end = $a_time;
        }

Here is the caller graph for this function:

ilObjRemoteCourse::setLocalInformation ( a_info  ) 

set local information

public

Parameters:
string local information

Definition at line 112 of file class.ilObjRemoteCourse.php.

Referenced by read().

        {
                $this->local_information = $a_info;
        }

Here is the caller graph for this function:

ilObjRemoteCourse::setStartingTime ( a_time  ) 

set starting time

public

Parameters:
int statrting time

Definition at line 147 of file class.ilObjRemoteCourse.php.

Referenced by read().

        {
                $this->start = $a_time;
        }

Here is the caller graph for this function:

ilObjRemoteCourse::update (  ) 

Update function.

public

Parameters:
 

Reimplemented from ilObject.

Definition at line 195 of file class.ilObjRemoteCourse.php.

References getAvailabilityType(), getEndingTime(), ilObject::getId(), getLocalInformation(), and getStartingTime().

        {
                global $ilDB;
                
                if (!parent::update())
                {                       
                        return false;
                }
                
                $query = "REPLACE INTO remote_course_settings ".
                        "SET availability_type = ".$this->db->quote($this->getAvailabilityType()).", ".
                        "start = ".$this->db->quote($this->getStartingTime()).", ".
                        "end = ".$this->db->quote($this->getEndingTime()).", ".
                        "local_information = ".$this->db->quote($this->getLocalInformation()).", ".
                        "obj_id = ".$this->db->quote($this->getId())." ";
                $this->db->query($query);
                return true;
        }

Here is the call graph for this function:


Field Documentation

ilObjRemoteCourse::$availability_type [protected]

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

ilObjRemoteCourse::$end [protected]

Definition at line 41 of file class.ilObjRemoteCourse.php.

ilObjRemoteCourse::$local_information [protected]

Definition at line 43 of file class.ilObjRemoteCourse.php.

ilObjRemoteCourse::$start [protected]

Definition at line 42 of file class.ilObjRemoteCourse.php.


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