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

LP collection base class. More...

+ Inheritance diagram for ilLPCollection:
+ Collaboration diagram for ilLPCollection:

Public Member Functions

 __construct ($a_obj_id, $a_mode)
 hasSelectableItems ()
 cloneCollection ($a_target_id, $a_copy_id)
 getItems ()
 delete ()
 isAssignedEntry ($a_item_id)
 deactivateEntries (array $a_item_ids)
 activateEntries (array $a_item_ids)

Protected Member Functions

 read ()
 validateEntry ($a_item_id)
 addEntry ($a_item_id)
 deleteEntry ($a_item_id)

Protected Attributes

 $obj_id
 $mode
 $items

Detailed Description

LP collection base class.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
Id:
class.ilLPCollections.php 40326 2013-03-05 11:39:24Z jluetzen

Definition at line 14 of file class.ilLPCollection.php.

Constructor & Destructor Documentation

ilLPCollection::__construct (   $a_obj_id,
  $a_mode 
)

Definition at line 20 of file class.ilLPCollection.php.

References read().

{
$this->obj_id = $a_obj_id;
$this->mode = $a_mode;
if($a_obj_id)
{
$this->read($a_obj_id);
}
}

+ Here is the call graph for this function:

Member Function Documentation

ilLPCollection::activateEntries ( array  $a_item_ids)

Reimplemented in ilLPCollectionOfRepositoryObjects.

Definition at line 167 of file class.ilLPCollection.php.

References addEntry().

{
foreach($a_item_ids as $item_id)
{
$this->addEntry($item_id);
}
}

+ Here is the call graph for this function:

ilLPCollection::addEntry (   $a_item_id)
protected

Reimplemented in ilLPCollectionOfRepositoryObjects.

Definition at line 130 of file class.ilLPCollection.php.

References $ilDB, $query, and isAssignedEntry().

Referenced by activateEntries().

{
global $ilDB;
if(!$this->isAssignedEntry($a_item_id))
{
$query = "INSERT INTO ut_lp_collections".
" (obj_id, lpmode, item_id)".
" VALUES (".$ilDB->quote($this->obj_id , "integer").
", ".$ilDB->quote($this->mode, "integer").
", ".$ilDB->quote($a_item_id , "integer").
")";
$ilDB->manipulate($query);
$this->items[] = $a_item_id;
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLPCollection::cloneCollection (   $a_target_id,
  $a_copy_id 
)

Reimplemented in ilLPCollectionOfRepositoryObjects.

Definition at line 36 of file class.ilLPCollection.php.

References $ilLog, $mode, ilCopyWizardOptions\_getInstance(), and ilObject\_lookupObjId().

{
global $ilLog;
$target_obj_id = ilObject::_lookupObjId($a_target_id);
include_once('Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
$mappings = $cwo->getMappings();
// #12067
$new_collection = new static($target_obj_id, $this->mode);
foreach($this->items as $item)
{
if(!isset($mappings[$item]) or !$mappings[$item])
{
continue;
}
$new_collection->addEntry($mappings[$item]);
}
$ilLog->write(__METHOD__.': cloned learning progress collection.');
}

+ Here is the call graph for this function:

ilLPCollection::deactivateEntries ( array  $a_item_ids)

Reimplemented in ilLPCollectionOfRepositoryObjects.

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

References deleteEntry().

{
foreach($a_item_ids as $item_id)
{
$this->deleteEntry($item_id);
}
}

+ Here is the call graph for this function:

ilLPCollection::delete ( )

Definition at line 94 of file class.ilLPCollection.php.

References $ilDB, and $query.

{
global $ilDB;
$query = "DELETE FROM ut_lp_collections".
" WHERE obj_id = ".$ilDB->quote($this->obj_id ,"integer");
$ilDB->manipulate($query);
$query = "DELETE FROM ut_lp_coll_manual".
" WHERE obj_id = ".$ilDB->quote($this->obj_id, "integer");
$ilDB->manipulate($query);
// #15462 - reset internal data
$this->items = array();
return true;
}
ilLPCollection::deleteEntry (   $a_item_id)
protected

Reimplemented in ilLPCollectionOfRepositoryObjects.

Definition at line 148 of file class.ilLPCollection.php.

References $ilDB, and $query.

Referenced by deactivateEntries(), and read().

{
global $ilDB;
$query = "DELETE FROM ut_lp_collections".
" WHERE obj_id = ".$ilDB->quote($this->obj_id, "integer").
" AND item_id = ".$ilDB->quote($a_item_id, "integer");
$ilDB->manipulate($query);
return true;
}

+ Here is the caller graph for this function:

ilLPCollection::getItems ( )

Definition at line 66 of file class.ilLPCollection.php.

References $items.

Referenced by ilLPCollectionOfRepositoryObjects\getGroupedItemsForLPStatus().

{
return $this->items;
}

+ Here is the caller graph for this function:

ilLPCollection::hasSelectableItems ( )

Reimplemented in ilLPCollectionOfObjectives.

Definition at line 31 of file class.ilLPCollection.php.

{
return true;
}
ilLPCollection::isAssignedEntry (   $a_item_id)

Definition at line 121 of file class.ilLPCollection.php.

Referenced by addEntry(), ilLPCollectionOfRepositoryObjects\addEntry(), ilLPCollectionOfRepositoryObjects\getPossibleItems(), ilLPCollectionOfLMChapters\getTableGUIData(), ilLPCollectionOfSCOs\getTableGUIData(), and ilLPCollectionOfRepositoryObjects\parseTableGUIItem().

{
if(is_array($this->items))
{
return (bool)in_array($a_item_id, $this->items);
}
return false;
}

+ Here is the caller graph for this function:

ilLPCollection::read ( )
protected

Reimplemented in ilLPCollectionOfRepositoryObjects.

Definition at line 71 of file class.ilLPCollection.php.

References $ilDB, $items, $res, $row, DB_FETCHMODE_OBJECT, deleteEntry(), and validateEntry().

Referenced by __construct().

{
global $ilDB;
$items = array();
$res = $ilDB->query("SELECT * FROM ut_lp_collections".
" WHERE obj_id = ".$ilDB->quote($this->obj_id, "integer"));
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
if($this->validateEntry($row->item_id))
{
$items[] = $row->item_id;
}
else
{
$this->deleteEntry($row->item_id);
}
}
$this->items = $items;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLPCollection::validateEntry (   $a_item_id)
protected

Definition at line 116 of file class.ilLPCollection.php.

Referenced by read().

{
return true;
}

+ Here is the caller graph for this function:

Field Documentation

ilLPCollection::$mode
protected
ilLPCollection::$obj_id
protected

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