Public Member Functions | Data Fields

ilBookmark Class Reference

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

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


Member Function Documentation

ilBookmark::create (  ) 

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

References $_SESSION, $q, 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 113 of file class.ilBookmark.php.

References $q, and 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 190 of file class.ilBookmark.php.

Referenced by create().

        {
                return $this->description;
        }

Here is the caller graph for this function:

ilBookmark::getId (  ) 

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

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

        {
                return $this->id;
        }

Here is the caller graph for this function:

ilBookmark::getParent (  ) 

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

Referenced by create().

        {
                return $this->parent;
        }

Here is the caller graph for this function:

ilBookmark::getTarget (  ) 

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

Referenced by create().

        {
                return $this->target;
        }

Here is the caller graph for this function:

ilBookmark::getTitle (  ) 

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

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:
integer user_id (optional)

Definition at line 62 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 89 of file class.ilBookmark.php.

References $ilias, $q, 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 185 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 156 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 211 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 200 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 171 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 137 of file class.ilBookmark.php.

References $q.

        {
                $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 52 of file class.ilBookmark.php.

ilBookmark::$id

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

ilBookmark::$ilias

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

Referenced by ilBookmark(), and read().

ilBookmark::$parent

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

ilBookmark::$target

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

ilBookmark::$title

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

ilBookmark::$tree

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

ilBookmark::$user_Id

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


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