ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilNote Class Reference

Note class. More...

+ Collaboration diagram for ilNote:

Public Member Functions

 ilNote ($a_id=0)
 constructor
 setId ($a_id)
 set id
 getId ()
 get id
 setObject ($a_obj_type, $a_rep_obj_id, $a_obj_id=0)
 set assigned object
 getObject ()
 setType ($a_type)
 set type
 getType ()
 get type
 setAuthor ($a_user_id)
 set author
 getAuthor ()
 get author
 setText ($a_text)
 set text
 getText ()
 get text
 setSubject ($a_subject)
 set subject
 getSubject ()
 get subject
 setCreationDate ($a_date)
 set creation date
 getCreationDate ()
 get creation date
 setUpdateDate ($a_date)
 set update date
 getUpdateDate ()
 get update date
 setLabel ($a_label)
 set label
 getLabel ()
 get label
 setInRepository ($a_value)
 set repository object status
 isInRepository ()
 belongs note to repository object?
 create ($a_use_provided_creation_date=false)
 update ()
 read ()
 delete ()
 delete note
 setAllData ($a_note_rec)
 set all note data by record array
 _lookupCreationDate ($a_id)
 lookup creation date of note
 _lookupUpdateDate ($a_id)
 lookup update date of note
 _getNotesOfObject ($a_rep_obj_id, $a_obj_id, $a_obj_type, $a_type=IL_NOTE_PRIVATE, $a_incl_sub=false, $a_filter="", $a_all_public="y", $a_repository_mode=true, $a_sort_ascending=false)
 get all notes related to a specific object
 _getLastNotesOfUser ()
 get last notes of current user
 _getRelatedObjectsOfUser ($a_mode)
 get all related objects for user

Static Public Member Functions

static getUserCount ($a_rep_obj_id, $a_obj_id, $a_type)
 How many users have attached a note/comment to a given object?
static _countNotesAndCommentsMultiple ($a_rep_obj_ids, $a_no_sub_objs=false)
 Get all notes related to multiple objcts.
static _countNotesAndComments ($a_rep_obj_id, $a_sub_obj_id=null)
 Get all notes related to a specific object.
static activateComments ($a_rep_obj_id, $a_obj_id, $a_obj_type, $a_activate=true)
 Activate notes feature.
static commentsActivated ($a_rep_obj_id, $a_obj_id, $a_obj_type)
 Are comments activated for object?
static getRepObjActivation ($a_rep_obj_ids)
 Get activation for repository objects.

Detailed Description

Note class.

Represents a single note.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
Id:
class.ilNote.php 52038 2014-08-05 14:06:59Z jluetzen

Definition at line 24 of file class.ilNote.php.

Member Function Documentation

static ilNote::_countNotesAndComments (   $a_rep_obj_id,
  $a_sub_obj_id = null 
)
static

Get all notes related to a specific object.

Parameters
array$a_rep_obj_idsrepository object IDs array
int$a_sub_obj_idsub objects (if null, all comments are counted)

Definition at line 665 of file class.ilNote.php.

References $ilDB, $ilUser, IL_NOTE_PRIVATE, and IL_NOTE_PUBLIC.

Referenced by ilObjectListGUI\getHeaderAction(), and ilPollBlockGUI\getNumberOfComments().

{
global $ilDB, $ilUser;
$q = "SELECT count(id) c, rep_obj_id, type FROM note WHERE ".
" ((type = ".$ilDB->quote(IL_NOTE_PRIVATE, "integer")." AND ".
"author = ".$ilDB->quote((int) $ilUser->getId(), "integer").") OR ".
" type = ".$ilDB->quote(IL_NOTE_PUBLIC, "integer").") AND ".
" rep_obj_id = ".$ilDB->quote($a_rep_obj_id, "integer");
if ($a_sub_obj_id !== null)
{
$q .= " AND obj_id = ".$ilDB->quote($a_sub_obj_id, "integer");
}
$q .= " GROUP BY rep_obj_id, type ";
$cnt = array();
$set = $ilDB->query($q);
while ($rec = $ilDB->fetchAssoc($set))
{
$cnt[$rec["rep_obj_id"]][$rec["type"]] = $rec["c"];
}
return $cnt;
}

+ Here is the caller graph for this function:

static ilNote::_countNotesAndCommentsMultiple (   $a_rep_obj_ids,
  $a_no_sub_objs = false 
)
static

Get all notes related to multiple objcts.

Parameters
array$a_rep_obj_idsrepository object IDs array
boolean$a_no_sub_objsinclude subobjects true/false

Definition at line 632 of file class.ilNote.php.

References $ilDB, $ilUser, IL_NOTE_PRIVATE, and IL_NOTE_PUBLIC.

Referenced by ilObjectListGUI\preloadCommonProperties().

{
global $ilDB, $ilUser;
$q = "SELECT count(id) c, rep_obj_id, type FROM note WHERE ".
" ((type = ".$ilDB->quote(IL_NOTE_PRIVATE, "integer")." AND ".
"author = ".$ilDB->quote((int) $ilUser->getId(), "integer").") OR ".
" type = ".$ilDB->quote(IL_NOTE_PUBLIC, "integer").") AND ".
$ilDB->in("rep_obj_id", $a_rep_obj_ids, false, "integer");
if ($a_no_sub_objs)
{
$q .= " AND obj_id = ".$ilDB->quote(0, "integer");
}
$q .= " GROUP BY rep_obj_id, type ";
$cnt = array();
$set = $ilDB->query($q);
while ($rec = $ilDB->fetchAssoc($set))
{
$cnt[$rec["rep_obj_id"]][$rec["type"]] = $rec["c"];
}
return $cnt;
}

+ Here is the caller graph for this function:

ilNote::_getLastNotesOfUser ( )

get last notes of current user

Definition at line 448 of file class.ilNote.php.

References $ilDB, $ilUser, IL_NOTE_PRIVATE, and ilNote().

Referenced by ilPDNotesBlockGUI\fillDataSection().

{
global $ilDB, $ilUser;
$q = "SELECT * FROM note WHERE ".
" type = ".$ilDB->quote((int) IL_NOTE_PRIVATE, "integer").
" AND author = ".$ilDB->quote((int) $ilUser->getId(), "integer").
" AND (no_repository IS NULL OR no_repository < ".$ilDB->quote(1, "integer").")".
" ORDER BY creation_date DESC";
$ilDB->quote($q);
$set = $ilDB->query($q);
$notes = array();
while($note_rec = $ilDB->fetchAssoc($set))
{
$cnt = count($notes);
$notes[$cnt] = new ilNote();
$notes[$cnt]->setAllData($note_rec);
}
return $notes;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilNote::_getNotesOfObject (   $a_rep_obj_id,
  $a_obj_id,
  $a_obj_type,
  $a_type = IL_NOTE_PRIVATE,
  $a_incl_sub = false,
  $a_filter = "",
  $a_all_public = "y",
  $a_repository_mode = true,
  $a_sort_ascending = false 
)

get all notes related to a specific object

Definition at line 393 of file class.ilNote.php.

References $ilDB, $ilUser, IL_NOTE_PRIVATE, and ilNote().

Referenced by ilDataCollectionRecord\getComments(), ilNoteGUI\getNoteListHTML(), and ilObjBlogGUI\renderList().

{
global $ilDB, $ilUser;
$author_where = ($a_type == IL_NOTE_PRIVATE || $a_all_public == "n")
? " AND author = ".$ilDB->quote((int) $ilUser->getId(), "integer")
: "";
$sub_where = (!$a_incl_sub)
? " AND obj_id = ".$ilDB->quote((int) $a_obj_id, "integer").
" AND obj_type = ".$ilDB->quote((string) $a_obj_type, "text")
: "";
if(!$a_repository_mode)
{
$sub_where .= " AND no_repository = ".$ilDB->quote(1, "integer");
}
$q = "SELECT * FROM note WHERE ".
" rep_obj_id = ".$ilDB->quote((int) $a_rep_obj_id, "integer").
$sub_where.
" AND type = ".$ilDB->quote((int) $a_type, "integer").
$author_where.
" ORDER BY creation_date ";
$q .= ((bool)$a_sort_ascending) ? "ASC" : "DESC";
$set = $ilDB->query($q);
$notes = array();
while($note_rec = $ilDB->fetchAssoc($set))
{
if ($a_filter != "")
{
if (!is_array($a_filter))
{
$a_filter = array($a_filter);
}
if (!in_array($note_rec["id"], $a_filter))
{
continue;
}
}
$cnt = count($notes);
$notes[$cnt] = new ilNote();
$notes[$cnt]->setAllData($note_rec);
}
return $notes;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilNote::_getRelatedObjectsOfUser (   $a_mode)

get all related objects for user

Definition at line 474 of file class.ilNote.php.

References $ilDB, $ilUser, $ref_id, ilObject\_getAllReferences(), ilObjUser\_lookupDesktopItems(), ilObject\_lookupType(), commentsActivated(), IL_NOTE_PRIVATE, IL_NOTE_PUBLIC, ilWorkspaceTree\lookupNodeId(), and ilPDNotesGUI\PRIVATE_NOTES.

Referenced by ilPDNotesGUI\view().

{
global $ilDB, $ilUser, $tree;
{
$q = "SELECT DISTINCT rep_obj_id FROM note WHERE ".
" type = ".$ilDB->quote((int) IL_NOTE_PRIVATE, "integer").
" AND author = ".$ilDB->quote($ilUser->getId(), "integer").
" AND (no_repository IS NULL OR no_repository < ".$ilDB->quote(1, "integer").")".
" ORDER BY rep_obj_id";
$ilDB->quote($q);
$set = $ilDB->query($q);
$reps = array();
while($rep_rec = $ilDB->fetchAssoc($set))
{
// #9343: deleted objects
if(ilObject::_lookupType($rep_rec["rep_obj_id"]))
{
$reps[] = array("rep_obj_id" => $rep_rec["rep_obj_id"]);
}
}
}
else
{
// all objects where the user wrote at least one comment
$q = "SELECT DISTINCT rep_obj_id FROM note WHERE ".
" type = ".$ilDB->quote((int) IL_NOTE_PUBLIC, "integer").
" AND author = ".$ilDB->quote($ilUser->getId(), "integer").
" AND (no_repository IS NULL OR no_repository < ".$ilDB->quote(1, "integer").")".
" ORDER BY rep_obj_id";
$set = $ilDB->query($q);
$reps = array();
while($rep_rec = $ilDB->fetchAssoc($set))
{
// #9343: deleted objects
if ($type = ilObject::_lookupType($rep_rec["rep_obj_id"]))
{
if (ilNote::commentsActivated($rep_rec["rep_obj_id"], "", $type))
{
$reps[] = array("rep_obj_id" => $rep_rec["rep_obj_id"]);
}
}
}
// additionally all objects on the personal desktop of the user
// that have at least on comment
$dis = ilObjUser::_lookupDesktopItems($ilUser->getId());
$obj_ids = array();
foreach($dis as $di)
{
$obj_ids[] = $di["obj_id"];
}
if (count($obj_ids) > 0)
{
$q = "SELECT DISTINCT rep_obj_id FROM note WHERE ".
$ilDB->in("rep_obj_id", $obj_ids, false, "integer").
" AND (no_repository IS NULL OR no_repository < ".$ilDB->quote(1, "integer").")";
$set = $ilDB->query($q);
while($rec = $ilDB->fetchAssoc($set))
{
$add = true;
reset($reps);
foreach ($reps as $r)
{
if ($r["rep_obj_id"] == $rec["rep_obj_id"])
{
$add = false;
}
}
if ($add)
{
$type = ilObject::_lookupType($rec["rep_obj_id"]);
if (ilNote::commentsActivated($rec["rep_obj_id"], "", $type))
{
$reps[] = array("rep_obj_id" => $rec["rep_obj_id"]);
}
}
}
}
}
if(sizeof($reps))
{
// check if notes/comments belong to objects in trash
// see ilNoteGUI::showTargets()
foreach($reps as $idx => $rep)
{
$has_active_ref = false;
// repository?
$ref_ids = ilObject::_getAllReferences($rep["rep_obj_id"]);
if($ref_ids)
{
$reps[$idx]["ref_ids"] = array_values($ref_ids);
foreach($ref_ids as $ref_id)
{
if(!$tree->isDeleted($ref_id))
{
$has_active_ref = true;
break;
}
}
}
else
{
// personal workspace?
include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
$wsp_tree = new ilWorkspaceTree($ilUser->getId());
$node_id = $wsp_tree->lookupNodeId($rep["rep_obj_id"]);
if($node_id)
{
$reps[$idx]["wsp_id"] = $node_id;
$has_active_ref = true;
}
}
if(!$has_active_ref)
{
unset($reps[$idx]);
}
}
}
return $reps;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilNote::_lookupCreationDate (   $a_id)

lookup creation date of note

Definition at line 363 of file class.ilNote.php.

References $ilDB, and getId().

Referenced by create().

{
global $ilDB;
$q = "SELECT * FROM note WHERE id = ".
$ilDB->quote((int) $this->getId(), "integer");
$set = $ilDB->query($q);
$note_rec = $ilDB->fetchAssoc($set);
return $note_rec["creation_date"];
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilNote::_lookupUpdateDate (   $a_id)

lookup update date of note

Definition at line 378 of file class.ilNote.php.

References $ilDB, and getId().

Referenced by update().

{
global $ilDB;
$q = "SELECT * FROM note WHERE id = ".
$ilDB->quote((int) $this->getId(), "integer");
$set = $ilDB->query($q);
$note_rec = $ilDB->fetchAssoc($set);
return $note_rec["update_date"];
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilNote::activateComments (   $a_rep_obj_id,
  $a_obj_id,
  $a_obj_type,
  $a_activate = true 
)
static

Activate notes feature.

Parameters
@return

Definition at line 698 of file class.ilNote.php.

References $ilDB.

Referenced by ilObjContentObject\createProperties(), ilObjBlog\doCreate(), ilObjBlog\doUpdate(), ilObjPortfolioBase\doUpdate(), ilObjPoll\doUpdate(), and ilObjContentObject\updateProperties().

{
global $ilDB;
if ($a_obj_type == "")
{
$a_obj_type = "-";
}
$set = $ilDB->query("SELECT * FROM note_settings ".
" WHERE rep_obj_id = ".$ilDB->quote((int) $a_rep_obj_id, "integer").
" AND obj_id = ".$ilDB->quote((int) $a_obj_id, "integer").
" AND obj_type = ".$ilDB->quote($a_obj_type, "text")
);
if ($rec = $ilDB->fetchAssoc($set))
{
if (($rec["activated"] == 0 && $a_activate) ||
($rec["activated"] == 1 && !$a_activate))
{
$ilDB->manipulate("UPDATE note_settings SET ".
" activated = ".$ilDB->quote((int) $a_activate, "integer").
" WHERE rep_obj_id = ".$ilDB->quote((int) $a_rep_obj_id, "integer").
" AND obj_id = ".$ilDB->quote((int) $a_obj_id, "integer").
" AND obj_type = ".$ilDB->quote($a_obj_type, "text")
);
}
}
else
{
if ($a_activate)
{
$q = "INSERT INTO note_settings ".
"(rep_obj_id, obj_id, obj_type, activated) VALUES (".
$ilDB->quote((int) $a_rep_obj_id, "integer").",".
$ilDB->quote((int) $a_obj_id, "integer").",".
$ilDB->quote($a_obj_type, "text").",".
$ilDB->quote(1, "integer").
")";
$ilDB->manipulate($q);
}
}
}

+ Here is the caller graph for this function:

static ilNote::commentsActivated (   $a_rep_obj_id,
  $a_obj_id,
  $a_obj_type 
)
static

Are comments activated for object?

Parameters
@return

Definition at line 746 of file class.ilNote.php.

References $ilDB.

Referenced by _getRelatedObjectsOfUser(), ilObjBlog\doRead(), ilObjPortfolioBase\doRead(), ilObjPoll\doRead(), ilNoteGUI\getNotesHTML(), ilPortfolioDataSet\getXmlRecord(), ilPollDataSet\getXmlRecord(), ilBlogDataSet\getXmlRecord(), ilNoteGUI\ilNoteGUI(), ilObjectGUI\initHeaderAction(), ilObjectListGUI\isCommentsActivated(), and ilObjContentObject\readProperties().

{
global $ilDB;
if ($a_obj_type == "")
{
$a_obj_type = "-";
}
$set = $ilDB->query("SELECT * FROM note_settings ".
" WHERE rep_obj_id = ".$ilDB->quote((int) $a_rep_obj_id, "integer").
" AND obj_id = ".$ilDB->quote((int) $a_obj_id, "integer").
" AND obj_type = ".$ilDB->quote($a_obj_type, "text")
);
$rec = $ilDB->fetchAssoc($set);
return $rec["activated"];
}

+ Here is the caller graph for this function:

ilNote::create (   $a_use_provided_creation_date = false)

Definition at line 246 of file class.ilNote.php.

References $ilDB, _lookupCreationDate(), getCreationDate(), getId(), and ilUtil\now().

{
global $ilDB;
$cd = ($a_use_provided_creation_date)
? $this->getCreationDate()
$this->id = $ilDB->nextId("note");
/*$q = "INSERT INTO note (id, rep_obj_id, obj_id, obj_type, type,".
"author, note_text, subject, label, creation_date) VALUES (".
$ilDB->quote($this->id, "integer").",".
$ilDB->quote((int) $this->rep_obj_id, "integer").",".
$ilDB->quote((int) $this->obj_id, "integer").",".
$ilDB->quote((string) $this->obj_type, "text").",".
$ilDB->quote((int) $this->type, "integer").",".
$ilDB->quote((int) $this->author, "integer").",".
$ilDB->quote((string) $this->text, "clob").",".
$ilDB->quote((string) $this->subject, "text").",".
$ilDB->quote((int) $this->label, "integer").",".
$ilDB->now().")";
$ilDB->manipulate($q);*/
$ilDB->insert("note", array(
"id" => array("integer", $this->id),
"rep_obj_id" => array("integer", (int) $this->rep_obj_id),
"obj_id" => array("integer", (int) $this->obj_id),
"obj_type" => array("text", (string) $this->obj_type),
"type" => array("integer", (int) $this->type),
"author" => array("integer", (int) $this->author),
"note_text" => array("clob", (string) $this->text),
"subject" => array("text", (string) $this->subject),
"label" => array("integer", (int) $this->label),
"creation_date" => array("timestamp", $cd),
"no_repository" => array("integer", $this->no_repository)
));
$this->creation_date = ilNote::_lookupCreationDate($this->getId());
}

+ Here is the call graph for this function:

ilNote::delete ( )

delete note

Definition at line 334 of file class.ilNote.php.

References $ilDB, and getId().

{
global $ilDB;
$q = "DELETE FROM note WHERE id = ".
$ilDB->quote((int) $this->getId(), "integer");
$ilDB->manipulate($q);
}

+ Here is the call graph for this function:

ilNote::getAuthor ( )

get author

Returns
int user id

Definition at line 119 of file class.ilNote.php.

{
return $this->author;
}
ilNote::getCreationDate ( )

get creation date

Returns
string creation date

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

Referenced by create().

{
return $this->creation_date;
}

+ Here is the caller graph for this function:

ilNote::getId ( )

get id

Returns
int note id

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

Referenced by _lookupCreationDate(), _lookupUpdateDate(), create(), delete(), read(), and update().

{
return $this->id;
}

+ Here is the caller graph for this function:

ilNote::getLabel ( )

get label

Returns
int IL_NOTE_UNLABELED | IL_NOTE_IMPORTANT | IL_NOTE_QUESTION | IL_NOTE_PRO | IL_NOTE_CONTRA

Definition at line 221 of file class.ilNote.php.

{
return $this->label;
}
ilNote::getObject ( )

Definition at line 76 of file class.ilNote.php.

{
return array("rep_obj_id" => $this->rep_obj_id,
"obj_id" => $this->obj_id,
"obj_type" => $this->obj_type);
}
static ilNote::getRepObjActivation (   $a_rep_obj_ids)
static

Get activation for repository objects.

Parameters
@return

Definition at line 769 of file class.ilNote.php.

References $ilDB.

Referenced by ilObjectListGUI\preloadCommonProperties().

{
global $ilDB;
$set = $ilDB->query("SELECT * FROM note_settings ".
" WHERE ".$ilDB->in("rep_obj_id", $a_rep_obj_ids, false, "integer").
" AND obj_id = 0 ");
$activations = array();
while ($rec = $ilDB->fetchAssoc($set))
{
if ($rec["activated"])
{
$activations[$rec["rep_obj_id"]][$rec["obj_type"]] = true;
}
}
return $activations;
}

+ Here is the caller graph for this function:

ilNote::getSubject ( )

get subject

Returns
string subject

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

{
return $this->subject;
}
ilNote::getText ( )

get text

Returns
string text

Definition at line 139 of file class.ilNote.php.

{
return $this->text;
}
ilNote::getType ( )

get type

Returns
int IL_NOTE_PUBLIC | IL_NOTE_PRIVATE

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

{
return $this->type;
}
ilNote::getUpdateDate ( )

get update date

Returns
string update date

Definition at line 199 of file class.ilNote.php.

{
return $this->update_date;
}
static ilNote::getUserCount (   $a_rep_obj_id,
  $a_obj_id,
  $a_type 
)
static

How many users have attached a note/comment to a given object?

Parameters
int$a_rep_obj_idobject id (as in object data)
int$a_obj_id(sub) object id
string$a_type(sub) object type

Definition at line 614 of file class.ilNote.php.

References $ilDB.

Referenced by ilBlogPostingGUI\deleteBlogPostingConfirmationScreen(), and ilWikiPageGUI\deleteWikiPageConfirmationScreen().

{
global $ilDB;
$set = $ilDB->queryF("SELECT count(DISTINCT author) cnt FROM note WHERE ".
"rep_obj_id = %s AND obj_id = %s AND obj_type = %s",
array("integer", "integer", "text"),
array((int) $a_rep_obj_id, (int) $a_obj_id, (string)$a_type));
$rec = $ilDB->fetchAssoc($set);
return (int) $rec["cnt"];
}

+ Here is the caller graph for this function:

ilNote::ilNote (   $a_id = 0)

constructor

Definition at line 30 of file class.ilNote.php.

References read().

Referenced by _getLastNotesOfUser(), and _getNotesOfObject().

{
if ($a_id > 0)
{
$this->id = $a_id;
$this->read();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilNote::isInRepository ( )

belongs note to repository object?

Returns
bool

Definition at line 241 of file class.ilNote.php.

{
return !$this->no_repository;
}
ilNote::read ( )

Definition at line 320 of file class.ilNote.php.

References $ilDB, getId(), and setAllData().

Referenced by ilNote().

{
global $ilDB;
$q = "SELECT * FROM note WHERE id = ".
$ilDB->quote((int) $this->getId(), "integer");
$set = $ilDB->query($q);
$note_rec = $ilDB->fetchAssoc($set);
$this->setAllData($note_rec);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilNote::setAllData (   $a_note_rec)

set all note data by record array

Definition at line 346 of file class.ilNote.php.

References setAuthor(), setCreationDate(), setId(), setInRepository(), setLabel(), setObject(), setSubject(), setText(), setType(), and setUpdateDate().

Referenced by read().

{
$this->setId($a_note_rec["id"]);
$this->setObject($a_note_rec["obj_type"], $a_note_rec["rep_obj_id"], $a_note_rec["obj_id"]);
$this->setType($a_note_rec["type"]);
$this->setAuthor($a_note_rec["author"]);
$this->setText($a_note_rec["note_text"]);
$this->setSubject($a_note_rec["subject"]);
$this->setLabel($a_note_rec["label"]);
$this->setCreationDate($a_note_rec["creation_date"]);
$this->setUpdateDate($a_note_rec["update_date"]);
$this->setInRepository(!(bool)$a_note_rec["no_repository"]);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilNote::setAuthor (   $a_user_id)

set author

Parameters
intauthor user id

Definition at line 109 of file class.ilNote.php.

Referenced by setAllData().

{
$this->author = $a_user_id;
}

+ Here is the caller graph for this function:

ilNote::setCreationDate (   $a_date)

set creation date

Parameters
stringcreation date

Definition at line 169 of file class.ilNote.php.

Referenced by setAllData().

{
$this->creation_date = $a_date;
}

+ Here is the caller graph for this function:

ilNote::setId (   $a_id)

set id

Parameters
intnote id

Definition at line 44 of file class.ilNote.php.

Referenced by setAllData().

{
$this->id = $a_id;
}

+ Here is the caller graph for this function:

ilNote::setInRepository (   $a_value)

set repository object status

Parameters
bool

Definition at line 231 of file class.ilNote.php.

Referenced by setAllData().

{
return $this->no_repository = !(bool)$a_value;
}

+ Here is the caller graph for this function:

ilNote::setLabel (   $a_label)

set label

Parameters
intIL_NOTE_UNLABELED | IL_NOTE_IMPORTANT | IL_NOTE_QUESTION | IL_NOTE_PRO | IL_NOTE_CONTRA

Definition at line 210 of file class.ilNote.php.

Referenced by setAllData().

{
return $this->label = $a_label;
}

+ Here is the caller graph for this function:

ilNote::setObject (   $a_obj_type,
  $a_rep_obj_id,
  $a_obj_id = 0 
)

set assigned object

Parameters
$a_typestring type of the object (e.g st,pg,crs ...)
$a_rep_obj_idint object id (NOT ref_id!) of repository object (e.g for page objects the obj_id of the learning module; for personal desktop this is set to 0)
$a_obj_idint object id (e.g for page objects the obj_id of the page object) for, this is set to 0 for normal repository objects like forums ...

Definition at line 69 of file class.ilNote.php.

Referenced by setAllData().

{
$this->rep_obj_id = $a_rep_obj_id;
$this->obj_id = $a_obj_id;
$this->obj_type = $a_obj_type;
}

+ Here is the caller graph for this function:

ilNote::setSubject (   $a_subject)

set subject

Parameters
stringtext

Definition at line 149 of file class.ilNote.php.

Referenced by setAllData().

{
$this->subject = $a_subject;
}

+ Here is the caller graph for this function:

ilNote::setText (   $a_text)

set text

Parameters
stringtext

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

Referenced by setAllData().

{
$this->text = $a_text;
}

+ Here is the caller graph for this function:

ilNote::setType (   $a_type)

set type

Parameters
intIL_NOTE_PUBLIC | IL_NOTE_PRIVATE

Definition at line 89 of file class.ilNote.php.

Referenced by setAllData().

{
$this->type = $a_type;
}

+ Here is the caller graph for this function:

ilNote::setUpdateDate (   $a_date)

set update date

Parameters
stringupdate date

Definition at line 189 of file class.ilNote.php.

Referenced by setAllData().

{
$this->update_date = $a_date;
}

+ Here is the caller graph for this function:

ilNote::update ( )

Definition at line 286 of file class.ilNote.php.

References $ilDB, _lookupUpdateDate(), getId(), and ilUtil\now().

{
global $ilDB;
/*$q = "UPDATE note SET ".
"rep_obj_id = ".$ilDB->quote((int) $this->rep_obj_id, "integer").",".
"obj_id = ".$ilDB->quote((int) $this->obj_id, "integer").",".
"obj_type = ".$ilDB->quote((string) $this->obj_type, "text").",".
"type = ".$ilDB->quote((int) $this->type, "integer").",".
"author = ".$ilDB->quote((int) $this->author,"integer").",".
"note_text = ".$ilDB->quote((string) $this->text, "clob").",".
"subject = ".$ilDB->quote((string) $this->subject, "text").",".
"update_date = ".$ilDB->now().",".
"label = ".$ilDB->quote((int) $this->label, "integer").
"WHERE id =".$ilDB->quote((int) $this->getId(), "integer");
$ilDB->manipulate($q);*/
$ilDB->update("note", array(
"rep_obj_id" => array("integer", (int) $this->rep_obj_id),
"obj_id" => array("integer", (int) $this->obj_id),
"obj_type" => array("text", (string) $this->obj_type),
"type" => array("integer", (int) $this->type),
"author" => array("integer", (int) $this->author),
"note_text" => array("clob", (string) $this->text),
"subject" => array("text", (string) $this->subject),
"label" => array("integer", (int) $this->label),
"update_date" => array("timestamp", ilUtil::now()),
"no_repository" => array("integer", $this->no_repository)
), array(
"id" => array("integer", $this->getId())
));
$this->update_date = ilNote::_lookupUpdateDate($this->getId());
}

+ Here is the call graph for this function:


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