ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilBookmark Class Reference

Class Bookmarks Bookmark management. More...

+ Collaboration diagram for ilBookmark:

Public Member Functions

 ilBookmark ($a_bm_id=0, $a_tree_id=0)
 Constructor public.
 read ()
 read bookmark folder data from db
 delete ()
 delete object data
 create ()
 update ()
 setId ($a_id)
 getId ()
 setTitle ($a_str)
 set title public
 getTitle ()
 setDescription ($a_str)
 set description public
 getDescription ()
 setTarget ($a_target)
 set target public
 getTarget ()
 setParent ($a_parent_id)
 getParent ()

Data Fields

 $user_Id
 $ilias
 $tree
 $title
 $description
 $target
 $id
 $parent

Detailed Description

Class Bookmarks Bookmark management.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Manfred Thaler manfr.nosp@m.ed.t.nosp@m.haler.nosp@m.@end.nosp@m.o7.co.nosp@m.m
Version
Id:
class.ilBookmark.php 15697 2008-01-08 20:04:33Z hschottm

Definition at line 33 of file class.ilBookmark.php.

Member Function Documentation

ilBookmark::create ( )

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

References $_SESSION, getDescription(), getId(), getParent(), getTarget(), getTitle(), and setId().

{
$q = sprintf(
"INSERT INTO bookmark_data (user_id, title,description, target, type) ".
"VALUES (%s,%s,%s,%s,%s)",
$this->ilias->db->quote($_SESSION["AccountId"]),
$this->ilias->db->quote($this->getTitle()),
$this->ilias->db->quote($this->getDescription()),
$this->ilias->db->quote($this->getTarget()),
$this->ilias->db->quote('bm')
);
$this->ilias->db->query($q);
$this->setId($this->ilias->db->getLastInsertId());
$this->tree->insertNode($this->getId(), $this->getParent());
}

+ Here is the call graph for this function:

ilBookmark::delete ( )

delete object data

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

References getId().

{
$q = "DELETE FROM bookmark_data WHERE obj_id = ".$this->ilias->db->quote($this->getId());
$this->ilias->db->query($q);
}

+ Here is the call graph for this function:

ilBookmark::getDescription ( )

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

References $description.

Referenced by create().

{
}

+ Here is the caller graph for this function:

ilBookmark::getId ( )

Definition at line 160 of file class.ilBookmark.php.

References $id.

Referenced by create(), delete(), and read().

{
return $this->id;
}

+ Here is the caller graph for this function:

ilBookmark::getParent ( )

Definition at line 215 of file class.ilBookmark.php.

References $parent.

Referenced by create().

{
return $this->parent;
}

+ Here is the caller graph for this function:

ilBookmark::getTarget ( )

Definition at line 205 of file class.ilBookmark.php.

References $target.

Referenced by create().

{
return $this->target;
}

+ Here is the caller graph for this function:

ilBookmark::getTitle ( )

Definition at line 175 of file class.ilBookmark.php.

References $title.

Referenced by create().

{
return $this->title;
}

+ Here is the caller graph for this function:

ilBookmark::ilBookmark (   $a_bm_id = 0,
  $a_tree_id = 0 
)

Constructor public.

Parameters
integeruser_id (optional)

Definition at line 61 of file class.ilBookmark.php.

References $_SESSION, $ilias, and read().

{
global $ilias;
// Initiate variables
$this->ilias =& $ilias;
if ($a_tree_id == 0)
{
$a_tree_id = $_SESSION["AccountId"];
}
$this->tree = new ilTree($a_tree_id);
$this->tree->setTableNames('bookmark_tree','bookmark_data');
$this->id = $a_bm_id;
if(!empty($this->id))
{
$this->read();
}
}

+ Here is the call graph for this function:

ilBookmark::read ( )

read bookmark folder data from db

Definition at line 88 of file class.ilBookmark.php.

References $ilias, DB_FETCHMODE_ASSOC, getId(), setDescription(), setParent(), setTarget(), and setTitle().

Referenced by ilBookmark().

{
global $ilias;
$q = "SELECT * FROM bookmark_data WHERE obj_id = ".$this->ilias->db->quote($this->getId());
$bm_set = $this->ilias->db->query($q);
if ($bm_set->numRows() == 0)
{
$message = "ilBookmark::read(): Bookmark with id ".$this->id." not found!";
$ilias->raiseError($message,$ilias->error_obj->WARNING);
}
else
{
$bm = $bm_set->fetchRow(DB_FETCHMODE_ASSOC);
$this->setTitle($bm["title"]);
$this->setDescription($bm["description"]);
$this->setTarget($bm["target"]);
$this->setParent($this->tree->getParentId($this->id));
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilBookmark::setDescription (   $a_str)

set description public

Parameters
string

Definition at line 184 of file class.ilBookmark.php.

Referenced by read().

{
$this->description = $a_str;
}

+ Here is the caller graph for this function:

ilBookmark::setId (   $a_id)

Definition at line 155 of file class.ilBookmark.php.

Referenced by create().

{
$this->id = $a_id;
}

+ Here is the caller graph for this function:

ilBookmark::setParent (   $a_parent_id)

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

Referenced by read().

{
$this->parent = $a_parent_id;
}

+ Here is the caller graph for this function:

ilBookmark::setTarget (   $a_target)

set target public

Parameters
string

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

Referenced by read().

{
$this->target = $a_target;
}

+ Here is the caller graph for this function:

ilBookmark::setTitle (   $a_str)

set title public

Parameters
string

Definition at line 170 of file class.ilBookmark.php.

Referenced by read().

{
$this->title = $a_str;
}

+ Here is the caller graph for this function:

ilBookmark::update ( )

Definition at line 136 of file class.ilBookmark.php.

{
$q = sprintf(
"UPDATE bookmark_data SET title=%s,description=%s,target=%s ".
"WHERE obj_id=%s",
$this->ilias->db->quote($this->getTitle()),
$this->ilias->db->quote($this->getDescription()),
$this->ilias->db->quote($this->getTarget()),
$this->ilias->db->quote($this->getId())
);
$this->ilias->db->query($q);
}

Field Documentation

ilBookmark::$description

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

Referenced by getDescription().

ilBookmark::$id

Definition at line 53 of file class.ilBookmark.php.

Referenced by getId().

ilBookmark::$ilias

Definition at line 47 of file class.ilBookmark.php.

Referenced by ilBookmark(), and read().

ilBookmark::$parent

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

Referenced by getParent().

ilBookmark::$target

Definition at line 52 of file class.ilBookmark.php.

Referenced by getTarget().

ilBookmark::$title

Definition at line 50 of file class.ilBookmark.php.

Referenced by getTitle().

ilBookmark::$tree

Definition at line 48 of file class.ilBookmark.php.

ilBookmark::$user_Id

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


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