Public Member Functions | Data Fields

ilLPEventCollections Class Reference

Public Member Functions

 ilLPEventCollections ($a_obj_id)
 getObjId ()
 getItems ()
 isAssigned ($a_obj_id)
 add ($item_id)
 delete ($item_id)
 _deleteAll ($a_obj_id)
 _getItems ($a_obj_id)
 __read ()

Data Fields

 $db = null
 $obj_id = null
 $items = array()

Detailed Description

Definition at line 35 of file class.ilLPEventCollections.php.


Member Function Documentation

ilLPEventCollections::__read (  ) 

Definition at line 134 of file class.ilLPEventCollections.php.

References $query, $res, $row, and ilEvent::_exists().

Referenced by add(), delete(), and ilLPEventCollections().

        {
                include_once 'course/classes/Event/class.ilEvent.php';

                global $ilObjDataCache;

                $query = "SELECT * FROM ut_lp_event_collections WHERE obj_id = '".$this->db->quote($this->obj_id)."'";
                $res = $this->db->query($query);
                while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
                {
                        if(!ilEvent::_exists($row->item_id))
                        {
                                $query = "DELETE FROM ut_lp_event_collections ".
                                        "WHERE obj_id = '".$a_obj_id."' ".
                                        "AND item_id = '".$row->item_id."'";
                                $this->db->query($query);
                                continue;
                        }
                        $this->items[] = $row->item_id;
                }
                
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilLPEventCollections::_deleteAll ( a_obj_id  ) 

Definition at line 98 of file class.ilLPEventCollections.php.

References $query.

        {
                global $ilDB;

                $query = "DELETE FROM ut_lp_collections ".
                        "WHERE obj_id = '".$a_obj_id."'";
                $ilDB->query($query);

                return true;
        }

ilLPEventCollections::_getItems ( a_obj_id  ) 

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

References $items, $query, $res, $row, and ilEvent::_exists().

Referenced by ilPDFPresentation::__renderContainerRow(), ilLPListOfObjectsGUI::__renderContainerRow(), ilLPListOfProgressGUI::__showContainerList(), ilLPStatusCollection::_getCompleted(), ilLPStatusCollection::_getInProgress(), and ilLPStatusCollection::_getStatusInfo().

        {
                include_once 'course/classes/Event/class.ilEvent.php';

                global $ilObjDataCache;
                global $ilDB;

                $query = "SELECT * FROM ut_lp_event_collections WHERE obj_id = '".(int) $a_obj_id."'";
                $res = $ilDB->query($query);
                while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
                {
                        if(!ilEvent::_exists($row->item_id))
                        {
                                $query = "DELETE FROM ut_lp_event_collections ".
                                        "WHERE obj_id = '".$a_obj_id."' ".
                                        "AND item_id = '".$row->item_id."'";
                                $ilDB->query($query);
                                continue;
                        }
                        $items[] = $row->item_id;
                }
                return $items ? $items : array();
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilLPEventCollections::add ( item_id  ) 

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

References $query, __read(), and isAssigned().

        {
                if($this->isAssigned($item_id))
                {
                        return false;
                }

                $query = "INSERT INTO ut_lp_event_collections ".
                        "SET obj_id = '".$this->obj_id."', ".
                        "item_id = '".(int) $item_id."'";
                $this->db->query($query);
                
                $this->__read();

                return true;
        }

Here is the call graph for this function:

ilLPEventCollections::delete ( item_id  ) 

Definition at line 85 of file class.ilLPEventCollections.php.

References $query, and __read().

        {
                $query = "DELETE FROM ut_lp_event_collections ".
                        "WHERE item_id = '".$item_id."' ".
                        "AND obj_id = '".$this->obj_id."'";
                $this->db->query($query);

                $this->__read();

                return true;
        }

Here is the call graph for this function:

ilLPEventCollections::getItems (  ) 

Definition at line 58 of file class.ilLPEventCollections.php.

        {
                return $this->items;
        }

ilLPEventCollections::getObjId (  ) 

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

        {
                return (int) $this->obj_id;
        }

ilLPEventCollections::ilLPEventCollections ( a_obj_id  ) 

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

References __read().

        {
                global $ilObjDataCache,$ilDB;

                $this->db =& $ilDB;

                $this->obj_id = $a_obj_id;

                $this->__read();
        }

Here is the call graph for this function:

ilLPEventCollections::isAssigned ( a_obj_id  ) 

Definition at line 63 of file class.ilLPEventCollections.php.

Referenced by add().

        {
                return (bool) in_array($a_obj_id,$this->items);
        }

Here is the caller graph for this function:


Field Documentation

ilLPEventCollections::$db = null

Definition at line 37 of file class.ilLPEventCollections.php.

ilLPEventCollections::$items = array()

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

Referenced by _getItems().

ilLPEventCollections::$obj_id = null

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


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