Public Member Functions | Data Fields

ilObjNote Class Reference

Inheritance diagram for ilObjNote:
Collaboration diagram for ilObjNote:

Public Member Functions

 ilObjNote ($a_id=0, $a_call_by_reference=false)
 Constructor public.
 viewObject ($a_note_id)
 get content of note
 createObject ($lo_title, $note_text)
 create a note object (entry) in object_data
 saveNote ($obj_id, $ref_lo, $lo_title, $text, $rate)
 save note object
 updateNote ($obj_id, $note_text, $rate)
 edit ()
 owner ()

Data Fields

 $ilias

Detailed Description

Definition at line 39 of file class.ilObjNote.php.


Member Function Documentation

ilObjNote::createObject ( lo_title,
note_text 
)

create a note object (entry) in object_data

Parameters:
string title of learning object, i.e
string short description of note
Returns:
integer note_id public

Definition at line 81 of file class.ilObjNote.php.

References $rbacadmin, $rbacsystem, ilObject::create(), ilObject::getId(), ilObject::setDescription(), ilObject::setTitle(), and ilObject::setType().

        {
                global $rbacadmin, $rbacsystem;         // not used (see below)

                $this->setType("note");
                $this->setTitle($lo_title);
                $this->setDescription($note_text);
                parent::create();
                $note_id = $this->getId();

                return $note_id;        
        }

Here is the call graph for this function:

ilObjNote::edit (  ) 

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

        {
        }

ilObjNote::ilObjNote ( a_id = 0,
a_call_by_reference = false 
)

Constructor public.

Parameters:
integer reference_id or object_id
boolean treat the id as reference_id (true) or object_id (false)

Definition at line 49 of file class.ilObjNote.php.

References $ilias, and ilObject::ilObject().

        {
                global $ilias;
                $this->ilias =& $ilias;
                
                $this->type = "note";
                $this->ilObject($a_id,$a_call_by_reference);
        }

Here is the call graph for this function:

ilObjNote::owner (  ) 

Definition at line 131 of file class.ilObjNote.php.

        {
        }

ilObjNote::saveNote ( obj_id,
ref_lo,
lo_title,
text,
rate 
)

save note object

Parameters:
integer id of note object
integer id of referenced LO
string text public

Definition at line 102 of file class.ilObjNote.php.

References ilObject::$create_date, $query, and $res.

        {
                $create_date = date("Y-m-d G:i:s");

                $query = "INSERT INTO note_data (note_id, lo_id,  text, create_date, important, good, question, bad)".
                                 " VALUES ('".$obj_id."','".$ref_lo."','".$text."','".$create_date."','".$rate["important"]."','".$rate["good"]."','".$rate["question"]."','".$rate["bad"]."')";

                $res = $this->ilias->db->query($query);
        }

ilObjNote::updateNote ( obj_id,
note_text,
rate 
)

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

References ilObject::$create_date, $obj_id, $q, ilObject::setDescription(), ilObject::setTitle(), and ilObject::update().

        {
                $create_date = date("Y-m-d G:i:s");     // not used
                
                //update table note_data
                $q = "UPDATE note_data SET text='".$note_text."', question='".$rate["question"]."', ".
                         "important='".$rate["important"]."', good='".$rate["good"]."', ".
                         "bad='".$rate["bad"]."' WHERE note_id='".$obj_id."'";
                $this->ilias->db->query($q);

                //update table object_data
                $this->setTitle($note_text);
                $this->setDescription($note_text);
                $this->update();
        }

Here is the call graph for this function:

ilObjNote::viewObject ( a_note_id  ) 

get content of note

Parameters:
integer a_note_id
Returns:
array note_data public

Definition at line 65 of file class.ilObjNote.php.

References $query, and $res.

        {
                $query = "SELECT * FROM note_data WHERE note_id = '".$a_note_id."'";
                $res = $this->ilias->db->query($query);
                $note_data = $res->fetchRow(DB_FETCHMODE_OBJECT);
                return $note_data;              
        }


Field Documentation

ilObjNote::$ilias

Reimplemented from ilObject.

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

Referenced by ilObjNote().


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