ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilDataCollectionTable Class Reference

Class ilDataCollectionField. More...

+ Collaboration diagram for ilDataCollectionTable:

Public Member Functions

 __construct ($a_id=0)
 Constructor.
 doRead ()
 Read table.
 doDelete ($delete_main_table=false)
 doDelete Attention this does not delete the maintable of it's the maintabla of the collection.
 doCreate ()
 Create new table.
 doUpdate ()
 setId ($a_id)
 Set table id.
 getId ()
 Get table id.
 setObjId ($a_id)
 Set object id.
 getObjId ()
 Get object id.
 setTitle ($a_title)
 Set title.
 getTitle ()
 Get title.
 getCollectionObject ()
 getCollectionObject
 getRecords ()
 getRecordsByFilter (array $filter=array())
 getRecordsByFilter
 getAll ($a_id)
 get all tables of a Data Collection Object
 deleteField ($field_id)
 getField ($field_id)
 getFieldIds ()
 getNewOrder ()
 getNewOrder
 getFields ()
 Returns all fields of this table including the standard fields.
 getStandardFields ()
 Returns the fields all datacollections have by default.
 getRecordFields ()
 Returns all fields of this table which are NOT standard fields.
 getVisibleFields ()
 Returns all fields of this table who have set their visibility to true, including standard fields.
 getEditableFields ()
 getFilterableFields ()
 getFilterableFields Returns all fields of this table who have set their filterable to true, including standard fields.
 getExportableFields ()
 Return all the fields that are marked as exportable.
 hasPermissionToFields ($ref_id)
 hasPermissionToAddTable ($ref_id)
 hasPermissionToAddRecord ($ref)
 hasPermissionToEditRecord ($ref, $record)
 hasPermissionToDeleteRecord ($ref, $record)
 updateFields ()
 sortFields (&$fields)
 sortFields
 buildOrderFields ()
 buildOrderFields orders the fields.
 getFieldByTitle ($name)
 setAddPerm ($add_perm)
 getAddPerm ()
 setDeletePerm ($delete_perm)
 getDeletePerm ()
 setEditByOwner ($edit_by_owner)
 getEditByOwner ()
 setEditPerm ($edit_perm)
 getEditPerm ()
 setLimited ($limited)
 getLimited ()
 setLimitEnd ($limit_end)
 getLimitEnd ()
 setLimitStart ($limit_start)
 getLimitStart ()
 setIsVisible ($is_visible)
 getIsVisible ()
 setDescription ($description)
 getDescription ()
 hasCustomFields ()
 hasCustomFields
 compareOrder ($a, $b)
 cloneStructure ($original_id)
 _hasRecords ()
 _hasRecords
 addField ($field)
 buildTableAsArray ()
 setExportEnabled ($export_enabled)
 getExportEnabled ()
 getPartialRecords ($sort, $direction, $limit, $offset, array $filter=array())
 Return only the needed subset of record objects for the table, according to sorting, paging and filters.

Static Public Member Functions

static _tableExists ($table_id)
static _getTableIdByTitle ($title, $obj_id)
static _hasFieldByTitle ($title, $obj_id)
 Checks if a table has a field with the given title.

Protected Attributes

 $id
 $objId
 $obj
 $title
 $export_enabled
 $description

Private Member Functions

 loadObj ()
 loadRecords ()
 loadFields ()
 checkEditByOwner ($record)
 checkLimit ()
 sortByOrder (&$array)

Private Attributes

 $fields
 $stdFields
 $records
 $is_visible
 $add_perm
 $edit_perm
 $delete_perm
 $edit_by_owner
 $limited
 $limit_start
 $limit_end

Detailed Description

Constructor & Destructor Documentation

ilDataCollectionTable::__construct (   $a_id = 0)

Constructor.

public

Parameters
integerfiel_id

Definition at line 78 of file class.ilDataCollectionTable.php.

References doRead().

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

+ Here is the call graph for this function:

Member Function Documentation

static ilDataCollectionTable::_getTableIdByTitle (   $title,
  $obj_id 
)
static
Parameters
$titleTitle of table
$obj_idDataCollection object ID where the table belongs to
Returns
int

Definition at line 991 of file class.ilDataCollectionTable.php.

References $id, $result, and $title.

Referenced by ilObjDataCollection\cloneStructure().

{
global $ilDB;
$result = $ilDB->query('SELECT id FROM il_dcl_table WHERE title = ' . $ilDB->quote($title, 'text') . ' AND obj_id = '
. $ilDB->quote($obj_id, 'integer'));
$id = 0;
while ($rec = $ilDB->fetchAssoc($result)) {
$id = $rec['id'];
}
return $id;
}

+ Here is the caller graph for this function:

static ilDataCollectionTable::_hasFieldByTitle (   $title,
  $obj_id 
)
static

Checks if a table has a field with the given title.

Parameters
$titleTitle of field
$obj_idObj-ID of the table
Returns
bool

Definition at line 1038 of file class.ilDataCollectionTable.php.

References $result, and $title.

Referenced by ilDataCollectionFieldEditGUI\checkInput().

{
global $ilDB;
$result = $ilDB->query('SELECT * FROM il_dcl_field WHERE table_id = ' . $ilDB->quote($obj_id, 'integer') . ' AND title = '
. $ilDB->quote($title, 'text'));
return ($ilDB->numRows($result)) ? true : false;
}

+ Here is the caller graph for this function:

ilDataCollectionTable::_hasRecords ( )

_hasRecords

Returns
boolean

Definition at line 958 of file class.ilDataCollectionTable.php.

References getRecords().

{
return (count($this->getRecords()) > 0) ? true : false;
}

+ Here is the call graph for this function:

static ilDataCollectionTable::_tableExists (   $table_id)
static
Parameters
$table_idint
Returns
bool returns true iff there exists a table with id $table_id

Definition at line 976 of file class.ilDataCollectionTable.php.

References $query, and $result.

Referenced by ilDataCollectionRecord\doCreate(), and ilDataCollectionField\doCreate().

{
global $ilDB;
$query = "SELECT * FROM il_dcl_table WHERE id = " . $table_id;
$result = $ilDB->query($query);
return $result->numRows() != 0;
}

+ Here is the caller graph for this function:

ilDataCollectionTable::addField (   $field)
Parameters
$fieldilDataCollectionField add an already created field for eg. ordering.

Definition at line 966 of file class.ilDataCollectionTable.php.

References fields.

{
$this->fields[$field->getId()] = $field;
}
ilDataCollectionTable::buildOrderFields ( )

buildOrderFields orders the fields.

Definition at line 713 of file class.ilDataCollectionTable.php.

References $fields, getFields(), and sortByOrder().

Referenced by doCreate().

{
$fields = $this->getFields();
$count = 10;
$offset = 10;
foreach ($fields as $field) {
if (! is_null($field->getOrder())) {
$field->setOrder($count);
$count = $count + $offset;
$field->doUpdate();
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionTable::buildTableAsArray ( )

Definition at line 1004 of file class.ilDataCollectionTable.php.

References $fields, $query, and getVisibleFields().

{
global $ilDB;
$table = array();
$query = " SELECT stloc.value AS val rec_field AS FROM il_dcl_stloc1_value stloc
INNER JOIN il_dcl_record_field rec_field ON rec_field.field_id = 2
WHERE stloc.record_field_id = rec_field.id";
}

+ Here is the call graph for this function:

ilDataCollectionTable::checkEditByOwner (   $record)
private

Definition at line 646 of file class.ilDataCollectionTable.php.

References $ilUser, and getEditByOwner().

Referenced by hasPermissionToDeleteRecord(), and hasPermissionToEditRecord().

{
global $ilUser;
if ($this->getEditByOwner() && $ilUser->getId() != $record->getOwner()) {
return false;
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionTable::checkLimit ( )
private

Definition at line 660 of file class.ilDataCollectionTable.php.

References getLimited(), getLimitEnd(), getLimitStart(), and IL_CAL_DATE.

Referenced by hasPermissionToAddRecord(), hasPermissionToDeleteRecord(), and hasPermissionToEditRecord().

{
if ($this->getLimited()) {
$now = new ilDateTime(date("Y-m-d H:i:s"), IL_CAL_DATE);
$from = new ilDateTime($this->getLimitStart(), IL_CAL_DATE);
$to = new ilDateTime($this->getLimitEnd(), IL_CAL_DATE);
return ($from <= $now && $now <= $to);
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionTable::cloneStructure (   $original_id)

Definition at line 923 of file class.ilDataCollectionTable.php.

References doCreate(), getId(), ilDataCollectionRecordViewViewdefinition\getIdByTableId(), ilDataCollectionCache\getTableCache(), setAddPerm(), setDeletePerm(), setEditByOwner(), setEditPerm(), setLimited(), setLimitEnd(), setLimitStart(), and setTitle().

{
$original = ilDataCollectionCache::getTableCache($original_id);
$this->setEditByOwner($original->getEditByOwner());
$this->setAddPerm($original->getAddPerm());
$this->setEditPerm($original->getEditPerm());
$this->setDeletePerm($original->getDeletePerm());
$this->setLimited($original->getLimited());
$this->setLimitStart($original->getLimitStart());
$this->setLimitEnd($original->getLimitEnd());
$this->setTitle($original->getTitle());
$this->doCreate();
//clone fields.
foreach ($original->getRecordFields() as $field) {
$new_field = new ilDataCollectionField();
$new_field->setTableId($this->getId());
$new_field->cloneStructure($field->getId());
}
$old_view = new ilDataCollectionRecordViewViewdefinition($old_view_id);
$old_view->setTableId($original_id);
$viewdef->setTableId($this->id);
$viewdef->setXMLContent($old_view->getXMLContent(false));
$viewdef->create();
}
}

+ Here is the call graph for this function:

ilDataCollectionTable::compareOrder (   $a,
  $b 
)

Definition at line 905 of file class.ilDataCollectionTable.php.

{
if (is_null($a->getOrder() == NULL) && is_null($b->getOrder() == NULL)) {
return 0;
}
if (is_null($a->getOrder())) {
return 1;
}
if (is_null($b->getOrder())) {
return - 1;
}
return $a->getOrder() < $b->getOrder() ? - 1 : 1;
}
ilDataCollectionTable::deleteField (   $field_id)

Definition at line 400 of file class.ilDataCollectionTable.php.

References $records, ilDataCollectionCache\getFieldCache(), and getRecords().

{
$records = $this->getRecords();
foreach ($records as $record) {
$record->deleteField($field_id);
}
$field->doDelete();
}

+ Here is the call graph for this function:

ilDataCollectionTable::doCreate ( )

Create new table.

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

References $id, $query, buildOrderFields(), ilDataCollectionField\EDIT_VIEW, ilDataCollectionField\EXPORTABLE_VIEW, ilDataCollectionField\FILTER_VIEW, getAddPerm(), getDeletePerm(), getDescription(), getEditByOwner(), getEditPerm(), getExportEnabled(), getId(), getIsVisible(), getLimited(), getLimitEnd(), getLimitStart(), getObjId(), getTitle(), setId(), and ilDataCollectionField\VIEW_VIEW.

Referenced by cloneStructure().

{
global $ilDB;
$id = $ilDB->nextId("il_dcl_table");
$this->setId($id);
$query = "INSERT INTO il_dcl_table (" . "id" . ", obj_id" . ", title" . ", add_perm" . ", edit_perm" . ", delete_perm" . ", edit_by_owner"
. ", limited" . ", limit_start" . ", limit_end" . ", is_visible" . ", export_enabled" . ", description" . " ) VALUES ("
. $ilDB->quote($this->getId(), "integer") . "," . $ilDB->quote($this->getObjId(), "integer") . ","
. $ilDB->quote($this->getTitle(), "text") . "," . $ilDB->quote($this->getAddPerm() ? 1 : 0, "integer") . ","
. $ilDB->quote($this->getEditPerm() ? 1 : 0, "integer") . "," . $ilDB->quote($this->getDeletePerm() ? 1 : 0, "integer") . ","
. $ilDB->quote($this->getEditByOwner() ? 1 : 0, "integer") . "," . $ilDB->quote($this->getLimited() ? 1 : 0, "integer") . ","
. $ilDB->quote($this->getLimitStart(), "timestamp") . "," . $ilDB->quote($this->getLimitEnd(), "timestamp") . ","
. $ilDB->quote($this->getIsVisible() ? 1 : 0, "integer") . "," . $ilDB->quote($this->getExportEnabled() ? 1 : 0, "integer") . ","
. $ilDB->quote($this->getDescription(), "text") . ")";
$ilDB->manipulate($query);
//add view definition
$view_id = $ilDB->nextId("il_dcl_view");
$query = "INSERT INTO il_dcl_view (id, table_id, type, formtype) VALUES (" . $ilDB->quote($view_id, "integer") . ", "
. $ilDB->quote($this->id, "integer") . ", " . $ilDB->quote(ilDataCollectionField::VIEW_VIEW, "integer") . ", "
. $ilDB->quote(1, "integer") . ")";
$ilDB->manipulate($query);
//add edit definition
$view_id = $ilDB->nextId("il_dcl_view");
$query = "INSERT INTO il_dcl_view (id, table_id, type, formtype) VALUES (" . $ilDB->quote($view_id, "integer") . ", "
. $ilDB->quote($this->id, "integer") . ", " . $ilDB->quote(ilDataCollectionField::EDIT_VIEW, "integer") . ", "
. $ilDB->quote(1, "integer") . ")";
$ilDB->manipulate($query);
//add filter definition
$view_id = $ilDB->nextId("il_dcl_view");
$query = "INSERT INTO il_dcl_view (id, table_id, type, formtype) VALUES (" . $ilDB->quote($view_id, "integer") . ", "
. $ilDB->quote($this->id, "integer") . ", " . $ilDB->quote(ilDataCollectionField::FILTER_VIEW, "integer") . ", "
. $ilDB->quote(1, "integer") . ")";
$ilDB->manipulate($query);
//add filter definition
$view_id = $ilDB->nextId("il_dcl_view");
$query = "INSERT INTO il_dcl_view (id, table_id, type, formtype) VALUES (" . $ilDB->quote($view_id, "integer") . ", "
. $ilDB->quote($this->id, "integer") . ", " . $ilDB->quote(ilDataCollectionField::EXPORTABLE_VIEW, "integer") . ", "
. $ilDB->quote(1, "integer") . ")";
$ilDB->manipulate($query);
$this->buildOrderFields();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionTable::doDelete (   $delete_main_table = false)

doDelete Attention this does not delete the maintable of it's the maintabla of the collection.

unlink the the maintable in the collections object to make this work.

Parameters
boolean$delete_main_tabletrue to delete table anyway

Definition at line 118 of file class.ilDataCollectionTable.php.

References $query, $row, getCollectionObject(), getId(), getRecordFields(), and getRecords().

{
global $ilDB;
foreach ($this->getRecords() as $record) {
$record->doDelete();
}
foreach ($this->getRecordFields() as $field) {
$field->doDelete();
}
// SW: Fix #12794 und #11405
// Problem is that when the DC object gets deleted, $this::getCollectionObject() tries to load the DC but it's not in the DB anymore
// If $delete_main_table is true, avoid getting the collection object
$exec_delete = false;
if ($delete_main_table) {
$exec_delete = true;
}
if (! $exec_delete && $this->getCollectionObject()->getMainTableId() != $this->getId()) {
$exec_delete = true;
}
if ($exec_delete) {
$query = "DELETE FROM il_dcl_table WHERE id = " . $ilDB->quote($this->getId(), "integer");
$ilDB->manipulate($query);
// Delete also view definitions
$set = $ilDB->query('SELECT * FROM il_dcl_view WHERE table_id = ' . $ilDB->quote($this->getId(), 'integer'));
$view_ids = array();
while ($row = $ilDB->fetchObject($set)) {
$view_ids[] = $row->id;
}
if (count($view_ids)) {
$ilDB->manipulate("DELETE FROM il_dcl_viewdefinition WHERE view_id IN (" . implode(',', $view_ids) . ")");
}
$ilDB->manipulate("DELETE FROM il_dcl_view WHERE table_id = " . $ilDB->quote($this->getId(), 'integer'));
}
}

+ Here is the call graph for this function:

ilDataCollectionTable::doRead ( )

Read table.

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

References $query, getId(), setAddPerm(), setDeletePerm(), setDescription(), setEditByOwner(), setEditPerm(), setExportEnabled(), setIsVisible(), setLimited(), setLimitEnd(), setLimitStart(), setObjId(), and setTitle().

Referenced by __construct().

{
global $ilDB;
$query = "SELECT * FROM il_dcl_table WHERE id = " . $ilDB->quote($this->getId(), "integer");
$set = $ilDB->query($query);
$rec = $ilDB->fetchAssoc($set);
$this->setObjId($rec["obj_id"]);
$this->setTitle($rec["title"]);
$this->setAddPerm($rec["add_perm"]);
$this->setEditPerm($rec["edit_perm"]);
$this->setDeletePerm($rec["delete_perm"]);
$this->setEditByOwner($rec["edit_by_owner"]);
$this->setExportEnabled($rec["export_enabled"]);
$this->setLimited($rec["limited"]);
$this->setLimitStart($rec["limit_start"]);
$this->setLimitEnd($rec["limit_end"]);
$this->setIsVisible($rec["is_visible"]);
$this->setDescription($rec['description']);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionTable::doUpdate ( )

Definition at line 211 of file class.ilDataCollectionTable.php.

References getAddPerm(), getDeletePerm(), getDescription(), getEditByOwner(), getEditPerm(), getExportEnabled(), getId(), getIsVisible(), getLimited(), getLimitEnd(), getLimitStart(), getObjId(), and getTitle().

{
global $ilDB;
$ilDB->update("il_dcl_table", array(
"obj_id" => array( "integer", $this->getObjId() ),
"title" => array( "text", $this->getTitle() ),
"add_perm" => array( "integer", $this->getAddPerm() ),
"edit_perm" => array( "integer", $this->getEditPerm() ),
"delete_perm" => array( "integer", $this->getDeletePerm() ),
"edit_by_owner" => array( "integer", $this->getEditByOwner() ),
"limited" => array( "integer", $this->getLimited() ),
"limit_start" => array( "timestamp", $this->getLimitStart() ),
"limit_end" => array( "timestamp", $this->getLimitEnd() ),
"is_visible" => array( "integer", $this->getIsVisible() ? 1 : 0 ),
"export_enabled" => array( "integer", $this->getExportEnabled() ? 1 : 0 ),
"description" => array( "text", $this->getDescription() ),
), array(
"id" => array( "integer", $this->getId() )
));
}

+ Here is the call graph for this function:

ilDataCollectionTable::getAddPerm ( )
Returns
boolean

Definition at line 760 of file class.ilDataCollectionTable.php.

References $add_perm.

Referenced by doCreate(), doUpdate(), and hasPermissionToAddRecord().

{
}

+ Here is the caller graph for this function:

ilDataCollectionTable::getAll (   $a_id)

get all tables of a Data Collection Object

Parameters
int$a_idobj_id

Definition at line 379 of file class.ilDataCollectionTable.php.

References $query.

Referenced by ilDataCollectionRecordListViewdefinitionGUI\initForm().

{
global $ilDB;
//build query
$query = "SELECT *
FROM il_dcl_table
WHERE obj_id = " . $ilDB->quote($a_id, "integer");
$set = $ilDB->query($query);
$all = array();
while ($rec = $ilDB->fetchAssoc($set)) {
$all[$rec['id']] = $rec;
}
return $all;
}

+ Here is the caller graph for this function:

ilDataCollectionTable::getCollectionObject ( )

getCollectionObject

Returns
ilObjDataCollection

Definition at line 298 of file class.ilDataCollectionTable.php.

References $obj, and loadObj().

Referenced by doDelete().

{
$this->loadObj();
return $this->obj;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionTable::getDeletePerm ( )
Returns
boolean

Definition at line 776 of file class.ilDataCollectionTable.php.

References $delete_perm.

Referenced by doCreate(), doUpdate(), and hasPermissionToDeleteRecord().

{
}

+ Here is the caller graph for this function:

ilDataCollectionTable::getDescription ( )
Returns
string

Definition at line 888 of file class.ilDataCollectionTable.php.

References $description.

Referenced by doCreate(), and doUpdate().

{
}

+ Here is the caller graph for this function:

ilDataCollectionTable::getEditableFields ( )

Definition at line 545 of file class.ilDataCollectionTable.php.

References $fields, and getRecordFields().

{
$editableFields = array();
foreach ($fields as $field) {
if (! $field->getLocked()) {
$editableFields[] = $field;
}
}
return $editableFields;
}

+ Here is the call graph for this function:

ilDataCollectionTable::getEditByOwner ( )
Returns
boolean

Definition at line 792 of file class.ilDataCollectionTable.php.

References $edit_by_owner.

Referenced by checkEditByOwner(), doCreate(), and doUpdate().

{
}

+ Here is the caller graph for this function:

ilDataCollectionTable::getEditPerm ( )
Returns
boolean

Definition at line 808 of file class.ilDataCollectionTable.php.

References $edit_perm.

Referenced by doCreate(), doUpdate(), and hasPermissionToEditRecord().

{
}

+ Here is the caller graph for this function:

ilDataCollectionTable::getExportableFields ( )

Return all the fields that are marked as exportable.

Returns
array ilDataCollectionField

Definition at line 584 of file class.ilDataCollectionTable.php.

References $fields, and getFields().

{
$fields = $this->getFields();
$exportableFields = array();
foreach ($fields as $field) {
if ($field->getExportable()) {
$exportableFields[] = $field;
}
}
return $exportableFields;
}

+ Here is the call graph for this function:

ilDataCollectionTable::getExportEnabled ( )
Returns
boolean

Definition at line 1025 of file class.ilDataCollectionTable.php.

References $export_enabled.

Referenced by doCreate(), and doUpdate().

{
}

+ Here is the caller graph for this function:

ilDataCollectionTable::getField (   $field_id)

Definition at line 415 of file class.ilDataCollectionTable.php.

References $fields, and getFields().

Referenced by getPartialRecords().

{
$fields = $this->getFields();
$field = NULL;
foreach ($fields as $field_1) {
if ($field_1->getId() == $field_id) {
$field = $field_1;
}
}
return $field;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionTable::getFieldByTitle (   $name)
Parameters
$name
Returns
ilDataCollectionField

Definition at line 736 of file class.ilDataCollectionTable.php.

References getFields().

Referenced by getPartialRecords().

{
$return = NULL;
foreach ($this->getFields() as $field) {
if ($field->getTitle() == $name) {
$return = $field;
break;
}
}
return $return;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionTable::getFieldIds ( )

Definition at line 431 of file class.ilDataCollectionTable.php.

References getFields().

{
return array_keys($this->getFields());
}

+ Here is the call graph for this function:

ilDataCollectionTable::getFields ( )

Returns all fields of this table including the standard fields.

Returns
ilDataCollectionField[]

Definition at line 484 of file class.ilDataCollectionTable.php.

References $fields, ilDataCollectionStandardField\_getStandardFields(), fields, loadFields(), and sortByOrder().

Referenced by buildOrderFields(), getExportableFields(), getField(), getFieldByTitle(), getFieldIds(), getFilterableFields(), getNewOrder(), getVisibleFields(), and updateFields().

{
$this->loadFields();
if ($this->stdFields == NULL) {
}
$fields = array_merge($this->fields, $this->stdFields);
return $fields;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionTable::getFilterableFields ( )

getFilterableFields Returns all fields of this table who have set their filterable to true, including standard fields.

Returns
ilDataCollectionField[]

Definition at line 565 of file class.ilDataCollectionTable.php.

References $fields, and getFields().

{
$fields = $this->getFields();
$filterableFields = array();
foreach ($fields as $field) {
if ($field->isFilterable()) {
$filterableFields[] = $field;
}
}
return $filterableFields;
}

+ Here is the call graph for this function:

ilDataCollectionTable::getId ( )

Get table id.

Returns
int

Definition at line 248 of file class.ilDataCollectionTable.php.

References $id.

Referenced by ilDataCollectionRecordListTableGUI\__construct(), cloneStructure(), doCreate(), doDelete(), doRead(), doUpdate(), getPartialRecords(), and loadFields().

{
return $this->id;
}

+ Here is the caller graph for this function:

ilDataCollectionTable::getIsVisible ( )
Returns
boolean

Definition at line 872 of file class.ilDataCollectionTable.php.

References $is_visible.

Referenced by doCreate(), and doUpdate().

{
}

+ Here is the caller graph for this function:

ilDataCollectionTable::getLimited ( )
Returns
boolean

Definition at line 824 of file class.ilDataCollectionTable.php.

References $limited.

Referenced by checkLimit(), doCreate(), and doUpdate().

{
}

+ Here is the caller graph for this function:

ilDataCollectionTable::getLimitEnd ( )
Returns
string

Definition at line 840 of file class.ilDataCollectionTable.php.

References $limit_end.

Referenced by checkLimit(), doCreate(), and doUpdate().

{
}

+ Here is the caller graph for this function:

ilDataCollectionTable::getLimitStart ( )
Returns
string

Definition at line 856 of file class.ilDataCollectionTable.php.

References $limit_start.

Referenced by checkLimit(), doCreate(), and doUpdate().

{
}

+ Here is the caller graph for this function:

ilDataCollectionTable::getNewOrder ( )

getNewOrder

Returns
int returns the place where a new field should be placed.

Definition at line 466 of file class.ilDataCollectionTable.php.

References $fields, and getFields().

{
$fields = $this->getFields();
$place = 0;
foreach ($fields as $field) {
if ($field->isVisible()) {
$place = $field->getOrder() + 1;
}
}
return $place;
}

+ Here is the call graph for this function:

ilDataCollectionTable::getObjId ( )

Get object id.

Returns
int

Definition at line 268 of file class.ilDataCollectionTable.php.

References $objId.

Referenced by doCreate(), and doUpdate().

{
return $this->objId;
}

+ Here is the caller graph for this function:

ilDataCollectionTable::getPartialRecords (   $sort,
  $direction,
  $limit,
  $offset,
array  $filter = array() 
)

Return only the needed subset of record objects for the table, according to sorting, paging and filters.

Parameters
string$sortTitle of a field where the ilTable2GUI is sorted
string$direction'desc' or 'asc'
int$limitLimit of records
int$offsetOffset from records
array$filterContaining the filter values
Returns
array Array with two keys: 'record' => Contains the record objects, 'total' => Number of total records (without slicing)

Definition at line 1058 of file class.ilDataCollectionTable.php.

References $id, $ilUser, $records, getField(), getFieldByTitle(), ilDataCollectionCache\getFieldCache(), getId(), ilDataCollectionCache\getRecordCache(), ilDataCollectionDatatype\INPUTFORMAT_BOOLEAN, ilDataCollectionDatatype\INPUTFORMAT_DATETIME, ilDataCollectionDatatype\INPUTFORMAT_FILE, ilDataCollectionDatatype\INPUTFORMAT_ILIAS_REF, ilDataCollectionDatatype\INPUTFORMAT_MOB, ilDataCollectionDatatype\INPUTFORMAT_NUMBER, ilDataCollectionDatatype\INPUTFORMAT_RATING, ilDataCollectionDatatype\INPUTFORMAT_REFERENCE, ilDataCollectionDatatype\INPUTFORMAT_TEXT, and ilDataCollectionField\PROPERTYID_N_REFERENCE.

{
global $ilDB;
$sortField = ($sort) ? $sortField = $this->getFieldByTitle($sort) : $sortField = $this->getField('id');
$direction = strtolower($direction);
$direction = (in_array($direction, array( 'desc', 'asc' ))) ? $direction : 'asc';
// Sorting by a status from an ILIAS Ref field. This column is added dynamically to the table, there is no field model
$sortByStatus = false;
if (substr($sort, 0, 8) == '_status_') {
$sortByStatus = true;
$sortField = $this->getFieldByTitle(substr($sort, 8));
}
if (is_null($sortField)) {
$sortField = $this->getField('id');
}
$id = $sortField->getId();
$stl = $sortField->getStorageLocation();
$selectStr = '';
$joinStr = '';
$where_additions = '';
$hasNref = false;
if ($sortField->isStandardField()) {
if ($id == 'owner' || $id == 'last_edit_by') {
$joinStr .= "LEFT JOIN usr_data AS sort_usr_data_{$id} ON (sort_usr_data_{$id}.usr_id = record.{$id})";
$selectStr .= " sort_usr_data_{$id}.login AS field_{$id},";
} else {
$selectStr .= " record.{$id} AS field_{$id},";
}
} else {
switch ($sortField->getDatatypeId()) {
$rating_joined = true;
// FSX Bugfix 0015735: The average is multiplied with 10000 and added to the amount of votes
$joinStr .= "LEFT JOIN (SELECT (ROUND(AVG(rating), 1) * 10000 + COUNT(rating)) as rating, obj_id FROM il_rating GROUP BY obj_id) AS average ON average.obj_id = record.id";
$selectStr .= " average.rating AS field_{$id},";
break;
$joinStr .=
"LEFT JOIN il_dcl_record_field AS sort_record_field_{$id} ON (sort_record_field_{$id}.record_id = record.id AND sort_record_field_{$id}.field_id = "
. $ilDB->quote($sortField->getId(), 'integer') . ") ";
$joinStr .= "LEFT JOIN il_dcl_stloc{$stl}_value AS sort_stloc_{$id} ON (sort_stloc_{$id}.record_field_id = sort_record_field_{$id}.id) ";
$joinStr .= "LEFT JOIN object_reference AS sort_object_reference_{$id} ON (sort_object_reference_{$id}.ref_id = sort_stloc_{$id}.value AND sort_object_reference_{$id}.deleted IS NULL)";
$joinStr .= "LEFT JOIN object_data AS sort_object_data_{$id} ON (sort_object_data_{$id}.obj_id = sort_object_reference_{$id}.obj_id)";
if ($sortByStatus) {
global $ilUser;
$joinStr .= "LEFT JOIN ut_lp_marks AS ut ON (ut.obj_id = sort_object_data_{$id}.obj_id AND ut.usr_id = "
. $ilDB->quote($ilUser->getId(), 'integer') . ") ";
}
$selectStr .= (! $sortByStatus) ? " sort_object_data_{$id}.title AS field_{$id}," : " ut.status AS field_{$id}";
break;
$joinStr .=
"LEFT JOIN il_dcl_record_field AS sort_record_field_{$id} ON (sort_record_field_{$id}.record_id = record.id AND sort_record_field_{$id}.field_id = "
. $ilDB->quote($sortField->getId(), 'integer') . ") ";
$joinStr .= "LEFT JOIN il_dcl_stloc{$stl}_value AS sort_stloc_{$id} ON (sort_stloc_{$id}.record_field_id = sort_record_field_{$id}.id) ";
$joinStr .= "LEFT JOIN object_data AS sort_object_data_{$id} ON (sort_object_data_{$id}.obj_id = sort_stloc_{$id}.value) ";
$selectStr .= " sort_object_data_{$id}.title AS field_{$id},";
break;
$prop = $sortField->getPropertyvalues();
$refField = ilDataCollectionCache::getFieldCache($sortField->getFieldRef());
if ($nRef) {
$hasNref = true;
}
$selectStr .= ($nRef) ? " GROUP_CONCAT(stloc_{$id}_joined.value) AS field_{$id}" : "stloc_{$id}_joined.value AS field_{$id},";
$joinStr .=
"LEFT JOIN il_dcl_record_field AS record_field_{$id} ON (record_field_{$id}.record_id = record.id AND record_field_{$id}.field_id = "
. $ilDB->quote($sortField->getId(), 'integer') . ") ";
$joinStr .= "LEFT JOIN il_dcl_stloc{$stl}_value AS stloc_{$id} ON (stloc_{$id}.record_field_id = record_field_{$id}.id) ";
$joinStr .=
"LEFT JOIN il_dcl_record_field AS record_field_{$id}_joined ON (record_field_{$id}_joined.record_id = stloc_{$id}.value AND record_field_{$id}_joined.field_id = "
. $ilDB->quote($refField->getId(), 'integer') . ") ";
$joinStr .= "LEFT JOIN il_dcl_stloc{$refField->getStorageLocation()}_value AS stloc_{$id}_joined ON (stloc_{$id}_joined.record_field_id = record_field_{$id}_joined.id) ";
break;
$selectStr .= " sort_stloc_{$id}.value AS field_{$id},";
$joinStr .=
"LEFT JOIN il_dcl_record_field AS sort_record_field_{$id} ON (sort_record_field_{$id}.record_id = record.id AND sort_record_field_{$id}.field_id = "
. $ilDB->quote($sortField->getId(), 'integer') . ") ";
$joinStr .= "LEFT JOIN il_dcl_stloc{$stl}_value AS sort_stloc_{$id} ON (sort_stloc_{$id}.record_field_id = sort_record_field_{$id}.id) ";
break;
}
}
if (count($filter)) {
foreach ($filter as $key => $filter_value) {
$filter_field_id = substr($key, 7);
$filterField = $this->getField($filter_field_id);
switch ($filterField->getDatatypeId()) {
if(!$rating_joined) {
$joinStr .= "LEFT JOIN (SELECT (ROUND(AVG(rating), 1) * 10000 + COUNT(rating)) as rating, obj_id FROM il_rating GROUP BY obj_id) AS average ON average.obj_id = record.id";
}
// FSX Bugfix 0015735: The average is multiplied with 10000 and added to the amount of votes
$where_additions .= " AND average.rating >= " . $ilDB->quote($filter_value * 10000, 'integer');
break;
$joinStr .=
"INNER JOIN il_dcl_record_field AS filter_record_field_{$filter_field_id} ON (filter_record_field_{$filter_field_id}.record_id = record.id AND filter_record_field_{$filter_field_id}.field_id = "
. $ilDB->quote($filter_field_id, 'integer') . ") ";
$joinStr .= "INNER JOIN il_dcl_stloc{$filterField->getStorageLocation()}_value AS filter_stloc_{$filter_field_id} ON (filter_stloc_{$filter_field_id}.record_field_id = filter_record_field_{$filter_field_id}.id) ";
$joinStr .= "INNER JOIN object_reference AS filter_object_reference_{$filter_field_id} ON (filter_object_reference_{$filter_field_id}.ref_id = filter_stloc_{$filter_field_id}.value ) ";
$joinStr .=
"INNER JOIN object_data AS filter_object_data_{$filter_field_id} ON (filter_object_data_{$filter_field_id}.obj_id = filter_object_reference_{$filter_field_id}.obj_id AND filter_object_data_{$filter_field_id}.title LIKE "
. $ilDB->quote("%$filter_value%", 'text') . ") ";
break;
$joinStr .=
"INNER JOIN il_dcl_record_field AS filter_record_field_{$filter_field_id} ON (filter_record_field_{$filter_field_id}.record_id = record.id AND filter_record_field_{$filter_field_id}.field_id = "
. $ilDB->quote($filter_field_id, 'integer') . ") ";
$joinStr .= "INNER JOIN il_dcl_stloc{$filterField->getStorageLocation()}_value AS filter_stloc_{$filter_field_id} ON (filter_stloc_{$filter_field_id}.record_field_id = filter_record_field_{$filter_field_id}.id) ";
$joinStr .=
"INNER JOIN object_data AS filter_object_data_{$filter_field_id} ON (filter_object_data_{$filter_field_id}.obj_id = filter_stloc_{$filter_field_id}.value AND filter_object_data_{$filter_field_id}.title LIKE "
. $ilDB->quote("%$filter_value%", 'text') . ") ";
break;
$dateFrom = (isset($filter_value['from']) && is_object($filter_value['from'])) ? $filter_value['from'] : NULL;
$dateTo = (isset($filter_value['to']) && is_object($filter_value['to'])) ? $filter_value['to'] : NULL;
if ($filterField->isStandardField()) {
if ($dateFrom) {
$where_additions .= " AND (record.{$filter_field_id} >= " . $ilDB->quote($dateFrom, 'date') . ")";
}
if ($dateTo) {
$where_additions .= " AND (record.{$filter_field_id} <= " . $ilDB->quote($dateTo, 'date') . ")";
}
} else {
$joinStr .=
"INNER JOIN il_dcl_record_field AS filter_record_field_{$filter_field_id} ON (filter_record_field_{$filter_field_id}.record_id = record.id AND filter_record_field_{$filter_field_id}.field_id = "
. $ilDB->quote($filter_field_id, 'integer') . ") ";
$joinStr .= "INNER JOIN il_dcl_stloc{$filterField->getStorageLocation()}_value AS filter_stloc_{$filter_field_id} ON (filter_stloc_{$filter_field_id}.record_field_id = filter_record_field_{$filter_field_id}.id ";
if ($dateFrom) {
$joinStr .= "AND filter_stloc_{$filter_field_id}.value >= " . $ilDB->quote($dateFrom, 'date') . " ";
}
if ($dateTo) {
$joinStr .= "AND filter_stloc_{$filter_field_id}.value <= " . $ilDB->quote($dateTo, 'date') . " ";
}
$joinStr .= ") ";
}
break;
$from = (isset($filter_value['from'])) ? (int)$filter_value['from'] : NULL;
$to = (isset($filter_value['to'])) ? (int)$filter_value['to'] : NULL;
if ($filterField->isStandardField()) {
if (! is_null($from)) {
$where_additions .= " AND record.{$filter_field_id} >= " . $ilDB->quote($from, 'integer');
}
if (! is_null($to)) {
$where_additions .= " AND record.{$filter_field_id} <= " . $ilDB->quote($to, 'integer');
}
} else {
$joinStr .=
"INNER JOIN il_dcl_record_field AS filter_record_field_{$filter_field_id} ON (filter_record_field_{$filter_field_id}.record_id = record.id AND filter_record_field_{$filter_field_id}.field_id = "
. $ilDB->quote($filter_field_id, 'integer') . ") ";
$joinStr .= "INNER JOIN il_dcl_stloc{$filterField->getStorageLocation()}_value AS filter_stloc_{$filter_field_id} ON (filter_stloc_{$filter_field_id}.record_field_id = filter_record_field_{$filter_field_id}.id";
if (! is_null($from)) {
$joinStr .= " AND filter_stloc_{$filter_field_id}.value >= " . $ilDB->quote($from, 'integer');
}
if (! is_null($to)) {
$joinStr .= " AND filter_stloc_{$filter_field_id}.value <= " . $ilDB->quote($to, 'integer');
}
$joinStr .= ") ";
}
break;
if ($filter_value == "checked") {
$joinStr .=
"INNER JOIN il_dcl_record_field AS filter_record_field_{$filter_field_id} ON (filter_record_field_{$filter_field_id}.record_id = record.id AND filter_record_field_{$filter_field_id}.field_id = "
. $ilDB->quote($filter_field_id, 'integer') . ") ";
$joinStr .= "INNER JOIN il_dcl_stloc{$filterField->getStorageLocation()}_value AS filter_stloc_{$filter_field_id} ON (filter_stloc_{$filter_field_id}.record_field_id = filter_record_field_{$filter_field_id}.id";
$joinStr .= " AND filter_stloc_{$filter_field_id}.value = " . $ilDB->quote(1, 'integer');
} else {
$joinStr .=
"INNER JOIN il_dcl_record_field AS filter_record_field_{$filter_field_id} ON (filter_record_field_{$filter_field_id}.record_id = record.id AND filter_record_field_{$filter_field_id}.field_id = "
. $ilDB->quote($filter_field_id, 'integer') . ") ";
$joinStr .= "LEFT JOIN il_dcl_stloc{$filterField->getStorageLocation()}_value AS filter_stloc_{$filter_field_id} ON (filter_stloc_{$filter_field_id}.record_field_id = filter_record_field_{$filter_field_id}.id";
$where_additions .= " AND (filter_stloc_{$filter_field_id}.value <> " . $ilDB->quote(1, 'integer')
. " OR filter_stloc_{$filter_field_id}.value is NULL)";
}
$joinStr .= " ) ";
break;
if ($filterField->isStandardField()) {
$joinStr .=
"INNER JOIN usr_data AS filter_usr_data_{$filter_field_id} ON (filter_usr_data_{$filter_field_id}.usr_id = record.{$filter_field_id} AND filter_usr_data_{$filter_field_id}.login LIKE "
. $ilDB->quote("%$filter_value%", 'text') . ") ";
} else {
$joinStr .=
" INNER JOIN il_dcl_record_field AS filter_record_field_{$filter_field_id} ON (filter_record_field_{$filter_field_id}.record_id = record.id AND filter_record_field_{$filter_field_id}.field_id = "
. $ilDB->quote($filter_field_id, 'integer') . ") ";
$joinStr .=
" INNER JOIN il_dcl_stloc{$filterField->getStorageLocation()}_value AS filter_stloc_{$filter_field_id} ON (filter_stloc_{$filter_field_id}.record_field_id = filter_record_field_{$filter_field_id}.id AND filter_stloc_{$filter_field_id}.value LIKE "
. $ilDB->quote("%$filter_value%", 'text') . ") ";
}
break;
$joinStr .=
" INNER JOIN il_dcl_record_field AS filter_record_field_{$filter_field_id} ON (filter_record_field_{$filter_field_id}.record_id = record.id AND filter_record_field_{$filter_field_id}.field_id = "
. $ilDB->quote($filter_field_id, 'integer') . ") ";
$prop = $filterField->getPropertyvalues();
if ($nRef) {
$joinStr .=
" INNER JOIN il_dcl_stloc{$filterField->getStorageLocation()}_value AS filter_stloc_{$filter_field_id} ON (filter_stloc_{$filter_field_id}.record_field_id = filter_record_field_{$filter_field_id}.id AND filter_stloc_{$filter_field_id}.value LIKE "
. $ilDB->quote("%$filter_value%", 'text') . ") ";
} else {
$joinStr .=
" INNER JOIN il_dcl_stloc{$filterField->getStorageLocation()}_value AS filter_stloc_{$filter_field_id} ON (filter_stloc_{$filter_field_id}.record_field_id = filter_record_field_{$filter_field_id}.id AND filter_stloc_{$filter_field_id}.value = "
. $ilDB->quote($filter_value, 'integer') . ") ";
}
break;
}
}
}
// Build the query string
$sql = "SELECT DISTINCT record.id, ";
$sql .= rtrim($selectStr, ',') . " FROM il_dcl_record AS record ";
$sql .= $joinStr;
$sql .= " WHERE record.table_id = " . $ilDB->quote($this->getId(), 'integer') . $where_additions;
if ($hasNref) {
$sql .= " GROUP BY record.id";
}
$sql .= " ORDER BY field_{$id} {$direction}";
$set = $ilDB->query($sql);
$totalRecordIds = array();
while ($rec = $ilDB->fetchAssoc($set)) {
$totalRecordIds[] = $rec['id'];
}
// Now slice the array to load only the needed records in memory
$recordIds = array_slice($totalRecordIds, $offset, $limit);
$records = array();
foreach ($recordIds as $id) {
}
return array( 'records' => $records, 'total' => count($totalRecordIds) );
}

+ Here is the call graph for this function:

ilDataCollectionTable::getRecordFields ( )

Returns all fields of this table which are NOT standard fields.

Returns
ilDataCollectionField[]

Definition at line 515 of file class.ilDataCollectionTable.php.

References $fields, and loadFields().

Referenced by doDelete(), and getEditableFields().

{
$this->loadFields();
return $this->fields;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionTable::getRecords ( )
Returns
ilDataCollectionRecord[]

Definition at line 318 of file class.ilDataCollectionTable.php.

References $records, and loadRecords().

Referenced by _hasRecords(), deleteField(), doDelete(), and getRecordsByFilter().

{
$this->loadRecords();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionTable::getRecordsByFilter ( array  $filter = array())

getRecordsByFilter

Parameters
$filterfilter is of the form array("filter_{field_id}" => filter); For dates and integers this filter must be of the form array("from" => from, "to" => to). In case of dates from and to have to be ilDateTime objects in case of integers they have to be integers as well.
Returns
ilDataCollectionRecord[]

Definition at line 336 of file class.ilDataCollectionTable.php.

References $records, getRecords(), and loadRecords().

{
$this->loadRecords();
// Only pass records trough filter if there is filtering required #performance-improvements
if (! count($filter)) {
}
$filtered = array();
foreach ($this->getRecords() as $record) {
if ($record->passThroughFilter($filter)) {
$filtered[] = $record;
}
}
return $filtered;
}

+ Here is the call graph for this function:

ilDataCollectionTable::getStandardFields ( )

Returns the fields all datacollections have by default.

Returns
ilDataCollectionStandardField[]

Definition at line 501 of file class.ilDataCollectionTable.php.

References $stdFields, and ilDataCollectionStandardField\_getStandardFields().

{
if ($this->stdFields == NULL) {
}
}

+ Here is the call graph for this function:

ilDataCollectionTable::getTitle ( )

Get title.

Returns
string

Definition at line 288 of file class.ilDataCollectionTable.php.

References $title.

Referenced by doCreate(), and doUpdate().

{
return $this->title;
}

+ Here is the caller graph for this function:

ilDataCollectionTable::getVisibleFields ( )

Returns all fields of this table who have set their visibility to true, including standard fields.

Returns
ilDataCollectionField[]

Definition at line 527 of file class.ilDataCollectionTable.php.

References $fields, and getFields().

Referenced by buildTableAsArray().

{
$fields = $this->getFields();
$visibleFields = array();
foreach ($fields as $field) {
if ($field->isVisible()) {
$visibleFields[] = $field;
}
}
return $visibleFields;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionTable::hasCustomFields ( )

hasCustomFields

Returns
boolean

Definition at line 898 of file class.ilDataCollectionTable.php.

References fields, and loadFields().

{
$this->loadFields();
return (count($this->fields) > 0) ? true : false;
}

+ Here is the call graph for this function:

ilDataCollectionTable::hasPermissionToAddRecord (   $ref)

Definition at line 613 of file class.ilDataCollectionTable.php.

References ilObjDataCollection\_hasReadAccess(), ilObjDataCollection\_hasWriteAccess(), checkLimit(), and getAddPerm().

+ Here is the call graph for this function:

ilDataCollectionTable::hasPermissionToAddTable (   $ref_id)

Definition at line 608 of file class.ilDataCollectionTable.php.

References $ref_id, and ilObjDataCollection\_hasWriteAccess().

+ Here is the call graph for this function:

ilDataCollectionTable::hasPermissionToDeleteRecord (   $ref,
  $record 
)
Parameters
$refint the reference id of the current datacollection object
$recordilDataCollectionRecord the record which will be deleted
Returns
bool

Definition at line 637 of file class.ilDataCollectionTable.php.

References ilObjDataCollection\_hasReadAccess(), ilObjDataCollection\_hasWriteAccess(), checkEditByOwner(), checkLimit(), and getDeletePerm().

{
return ($this->getDeletePerm() && ilObjDataCollection::_hasReadAccess($ref) && $this->checkEditByOwner($record) && $this->checkLimit())
}

+ Here is the call graph for this function:

ilDataCollectionTable::hasPermissionToEditRecord (   $ref,
  $record 
)
Parameters
$refint the reference id of the current datacollection object
$recordilDataCollectionRecord the record which will be edited
Returns
bool

Definition at line 625 of file class.ilDataCollectionTable.php.

References ilObjDataCollection\_hasReadAccess(), ilObjDataCollection\_hasWriteAccess(), checkEditByOwner(), checkLimit(), and getEditPerm().

{
return ($this->getEditPerm() && ilObjDataCollection::_hasReadAccess($ref) && $this->checkEditByOwner($record) && $this->checkLimit())
}

+ Here is the call graph for this function:

ilDataCollectionTable::hasPermissionToFields (   $ref_id)

Definition at line 600 of file class.ilDataCollectionTable.php.

References $ref_id, and ilObjDataCollection\_hasWriteAccess().

+ Here is the call graph for this function:

ilDataCollectionTable::loadFields ( )
private

Definition at line 439 of file class.ilDataCollectionTable.php.

References $fields, $query, ilDataCollectionCache\buildFieldFromRecord(), fields, getId(), and sortByOrder().

Referenced by getFields(), getRecordFields(), and hasCustomFields().

{
if ($this->fields == NULL) {
global $ilDB;
$query = "SELECT DISTINCT field.* FROM il_dcl_field AS field
INNER JOIN il_dcl_view AS view ON view.table_id = field.table_id
INNER JOIN il_dcl_viewdefinition AS def ON def.view_id = view.id
WHERE field.table_id =" . $ilDB->quote($this->getId(), "integer") . "
ORDER BY def.field_order DESC";
$fields = array();
$set = $ilDB->query($query);
while ($rec = $ilDB->fetchAssoc($set)) {
$fields[$field->getId()] = $field;
}
$this->fields = $fields;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionTable::loadObj ( )
private

Definition at line 308 of file class.ilDataCollectionTable.php.

Referenced by getCollectionObject().

{
if ($this->obj == NULL) {
$this->obj = new ilObjDataCollection($this->objId, false);
}
}

+ Here is the caller graph for this function:

ilDataCollectionTable::loadRecords ( )
private

Definition at line 356 of file class.ilDataCollectionTable.php.

References $query, $records, and ilDataCollectionCache\getRecordCache().

Referenced by getRecords(), and getRecordsByFilter().

{
if ($this->records == NULL) {
global $ilDB;
$records = array();
$query = "SELECT id FROM il_dcl_record WHERE table_id = " . $ilDB->quote($this->id, "integer");
$set = $ilDB->query($query);
while ($rec = $ilDB->fetchAssoc($set)) {
}
$this->records = $records;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionTable::setAddPerm (   $add_perm)
Parameters
boolean$add_perm

Definition at line 752 of file class.ilDataCollectionTable.php.

References $add_perm.

Referenced by cloneStructure(), and doRead().

{
$this->add_perm = $add_perm;
}

+ Here is the caller graph for this function:

ilDataCollectionTable::setDeletePerm (   $delete_perm)
Parameters
boolean$delete_perm

Definition at line 768 of file class.ilDataCollectionTable.php.

References $delete_perm.

Referenced by cloneStructure(), and doRead().

{
$this->delete_perm = $delete_perm;
}

+ Here is the caller graph for this function:

ilDataCollectionTable::setDescription (   $description)
Parameters
string$description

Definition at line 880 of file class.ilDataCollectionTable.php.

References $description.

Referenced by doRead().

{
$this->description = $description;
}

+ Here is the caller graph for this function:

ilDataCollectionTable::setEditByOwner (   $edit_by_owner)
Parameters
boolean$edit_by_owner

Definition at line 784 of file class.ilDataCollectionTable.php.

References $edit_by_owner.

Referenced by cloneStructure(), and doRead().

{
$this->edit_by_owner = $edit_by_owner;
}

+ Here is the caller graph for this function:

ilDataCollectionTable::setEditPerm (   $edit_perm)
Parameters
boolean$edit_perm

Definition at line 800 of file class.ilDataCollectionTable.php.

References $edit_perm.

Referenced by cloneStructure(), and doRead().

{
$this->edit_perm = $edit_perm;
}

+ Here is the caller graph for this function:

ilDataCollectionTable::setExportEnabled (   $export_enabled)
Parameters
boolean$export_enabled

Definition at line 1017 of file class.ilDataCollectionTable.php.

References $export_enabled.

Referenced by doRead().

{
$this->export_enabled = $export_enabled;
}

+ Here is the caller graph for this function:

ilDataCollectionTable::setId (   $a_id)

Set table id.

Parameters
int$a_id

Definition at line 238 of file class.ilDataCollectionTable.php.

Referenced by doCreate().

{
$this->id = $a_id;
}

+ Here is the caller graph for this function:

ilDataCollectionTable::setIsVisible (   $is_visible)
Parameters
boolean$is_visible

Definition at line 864 of file class.ilDataCollectionTable.php.

References $is_visible.

Referenced by doRead().

{
$this->is_visible = $is_visible;
}

+ Here is the caller graph for this function:

ilDataCollectionTable::setLimited (   $limited)
Parameters
boolean$limited

Definition at line 816 of file class.ilDataCollectionTable.php.

References $limited.

Referenced by cloneStructure(), and doRead().

{
$this->limited = $limited;
}

+ Here is the caller graph for this function:

ilDataCollectionTable::setLimitEnd (   $limit_end)
Parameters
string$limit_end

Definition at line 832 of file class.ilDataCollectionTable.php.

References $limit_end.

Referenced by cloneStructure(), and doRead().

{
$this->limit_end = $limit_end;
}

+ Here is the caller graph for this function:

ilDataCollectionTable::setLimitStart (   $limit_start)
Parameters
string$limit_start

Definition at line 848 of file class.ilDataCollectionTable.php.

References $limit_start.

Referenced by cloneStructure(), and doRead().

{
$this->limit_start = $limit_start;
}

+ Here is the caller graph for this function:

ilDataCollectionTable::setObjId (   $a_id)

Set object id.

Parameters
int$obj_id

Definition at line 258 of file class.ilDataCollectionTable.php.

Referenced by doRead().

{
$this->objId = $a_id;
}

+ Here is the caller graph for this function:

ilDataCollectionTable::setTitle (   $a_title)

Set title.

Parameters
string$a_title

Definition at line 278 of file class.ilDataCollectionTable.php.

Referenced by cloneStructure(), and doRead().

{
$this->title = $a_title;
}

+ Here is the caller graph for this function:

ilDataCollectionTable::sortByOrder ( $array)
private
Parameters
$arrayilDataCollectionField[] the array to sort

Definition at line 704 of file class.ilDataCollectionTable.php.

Referenced by buildOrderFields(), getFields(), loadFields(), and sortFields().

{
usort($array, array( $this, "compareOrder" ));
}

+ Here is the caller graph for this function:

ilDataCollectionTable::sortFields ( $fields)

sortFields

Parameters
$fieldsilDataCollectionField[]

Definition at line 687 of file class.ilDataCollectionTable.php.

References $fields, and sortByOrder().

{
//After sorting the array loses it's keys respectivly their keys are set form $field->id to 1,2,3... so we reset the keys.
$named = array();
foreach ($fields as $field) {
$named[$field->getId()] = $field;
}
$fields = $named;
}

+ Here is the call graph for this function:

ilDataCollectionTable::updateFields ( )

Definition at line 675 of file class.ilDataCollectionTable.php.

References getFields().

{
foreach ($this->getFields() as $field) {
$field->doUpdate();
}
}

+ Here is the call graph for this function:

Field Documentation

ilDataCollectionTable::$add_perm
private

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

Referenced by getAddPerm(), and setAddPerm().

ilDataCollectionTable::$delete_perm
private

Definition at line 43 of file class.ilDataCollectionTable.php.

Referenced by getDeletePerm(), and setDeletePerm().

ilDataCollectionTable::$description
protected

Definition at line 67 of file class.ilDataCollectionTable.php.

Referenced by getDescription(), and setDescription().

ilDataCollectionTable::$edit_by_owner
private

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

Referenced by getEditByOwner(), and setEditByOwner().

ilDataCollectionTable::$edit_perm
private

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

Referenced by getEditPerm(), and setEditPerm().

ilDataCollectionTable::$export_enabled
protected

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

Referenced by getExportEnabled(), and setExportEnabled().

ilDataCollectionTable::$id
protected
ilDataCollectionTable::$is_visible
private

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

Referenced by getIsVisible(), and setIsVisible().

ilDataCollectionTable::$limit_end
private

Definition at line 59 of file class.ilDataCollectionTable.php.

Referenced by getLimitEnd(), and setLimitEnd().

ilDataCollectionTable::$limit_start
private

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

Referenced by getLimitStart(), and setLimitStart().

ilDataCollectionTable::$limited
private

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

Referenced by getLimited(), and setLimited().

ilDataCollectionTable::$obj
protected

Definition at line 23 of file class.ilDataCollectionTable.php.

Referenced by getCollectionObject().

ilDataCollectionTable::$objId
protected

Definition at line 22 of file class.ilDataCollectionTable.php.

Referenced by getObjId().

ilDataCollectionTable::$records
private
ilDataCollectionTable::$stdFields
private

Definition at line 26 of file class.ilDataCollectionTable.php.

Referenced by getStandardFields().

ilDataCollectionTable::$title
protected

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

Referenced by _getTableIdByTitle(), _hasFieldByTitle(), and getTitle().


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