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

Class ilDataCollectionField. More...

+ Inheritance diagram for ilDataCollectionField:
+ Collaboration diagram for ilDataCollectionField:

Public Member Functions

 __construct ($a_id=0)
 setId ($a_id)
 Set field id.
 getId ()
 Get field id.
 setTableId ($a_id)
 Set table id.
 getTableId ()
 Get table id.
 setTitle ($a_title)
 Set title.
 getTitle ()
 Get title.
 setDescription ($a_desc)
 Set description.
 getDescription ()
 Get description.
 setDatatypeId ($a_id)
 Set datatype id.
 getDatatypeId ()
 Get datatype_id.
 setRequired ($a_required)
 Set Required.
 getRequired ()
 Get Required Required.
 setPropertyvalue ($a_value, $a_id)
 Set Property Value.
 isUnique ()
 setUnique ($unique)
 getPropertyvalues ()
 Get Property Values.
 setVisible ($visible)
 setVisible
 setFilterable ($filterable)
 setFilterable
 getDatatype ()
 getLength ()
 getTextArea ()
 getLearningProgress ()
 getDatatypeTitle ()
 getStorageLocation ()
 isVisible ()
 isFilterable ()
 isEditable ()
 isEditable
 setEditable ($editable)
 getExportable ()
 toArray ()
 isStandardField ()
 doRead ()
 Read field.
 buildFromDBRecord ($rec)
 doCreate ()
 Create new field.
 doUpdate ()
 Update field.
 getFilterable ()
 doDelete ()
 getOrder ()
 setOrder ($order)
 getFieldRef ()
 getFieldReflist ()
 isNRef ()
 getProperties ()
 Get all properties of a field.
 setProperties ($data)
 setLocked ($locked)
 getLocked ()
 checkValidity ($value, $record_id=NULL)
 cloneStructure ($original_id)
 cloneProperties (ilDataCollectionField $originalField)
 setExportable ($exportable)

Static Public Member Functions

static _getTitleValidChars ($a_as_regex=true)
 All valid chars for filed titles.
static _getFieldIdByTitle ($title, $table_id)

Data Fields

const PROPERTYID_LENGTH = 1
const PROPERTYID_REGEX = 2
const PROPERTYID_REFERENCE = 3
const PROPERTYID_URL = 4
 LINK OR EMAIL!
const PROPERTYID_TEXTAREA = 5
const PROPERTYID_REFERENCE_LINK = 6
const PROPERTYID_WIDTH = 7
const PROPERTYID_HEIGHT = 8
const PROPERTYID_LEARNING_PROGRESS = 9
const PROPERTYID_ILIAS_REFERENCE_LINK = 10
const PROPERTYID_N_REFERENCE = 11
const PROPERTYID_FORMULA_EXPRESSION = 12
const PROPERTYID_DISPLAY_COPY_LINK_ACTION_MENU = 13
const PROPERTYID_LINK_DETAIL_PAGE_TEXT = 14
const PROPERTYID_LINK_DETAIL_PAGE_MOB = 15
const PROPERTYID_SUPPORTED_FILE_TYPES = 16
const VIEW_VIEW = 1
const EDIT_VIEW = 2
const FILTER_VIEW = 3
const EXPORTABLE_VIEW = 4

Protected Member Functions

 loadDatatype ()
 loadVisibility ()
 loadFilterability ()
 loadViewDefinition ($view)
 loadViewDefinition
 updateProperties ()
 Update properties of this field in Database.
 updateVisibility ()
 updateFilterability ()
 updateEditability ()
 updateExportability ()

Protected Attributes

 $id
 $table_id
 $title
 $description
 $datatypeId
 $required
 $order
 $unique
 $visible
 $editable
 $filterable
 $locked
 $property = array()
 $exportable
 $datatype

Private Member Functions

 loadEditability ()
 loadExportability ()
 updateViewDefinition ($view)
 updateViewDefinition
 deleteViewDefinition ($view)
 loadProperties ()
 Get all properties of a field.

Detailed Description

Constructor & Destructor Documentation

ilDataCollectionField::__construct (   $a_id = 0)
Parameters
int$a_id

Definition at line 110 of file class.ilDataCollectionField.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 ilDataCollectionField::_getFieldIdByTitle (   $title,
  $table_id 
)
static
Parameters
$titleTitle of the field
$table_idID of table where the field belongs to
Returns
int

Definition at line 140 of file class.ilDataCollectionField.php.

References $id, $ilDB, $result, $table_id, and $title.

Referenced by ilObjDataCollection\cloneStructure().

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

+ Here is the caller graph for this function:

static ilDataCollectionField::_getTitleValidChars (   $a_as_regex = true)
static

All valid chars for filed titles.

Parameters
bool$a_as_regex
Returns
string

Definition at line 125 of file class.ilDataCollectionField.php.

Referenced by ilDataCollectionFieldEditGUI\initForm().

{
if ($a_as_regex) {
return '/^[a-zA-Z\d \/\-.,äöüÄÖÜàéèÀÉÈç¢]*$/i';
} else {
return 'A-Z a-z 0-9 /-.,';
}
}

+ Here is the caller graph for this function:

ilDataCollectionField::buildFromDBRecord (   $rec)

Definition at line 589 of file class.ilDataCollectionField.php.

References setDatatypeId(), setDescription(), setId(), setLocked(), setRequired(), setTableId(), setTitle(), and setUnique().

{
$this->setId($rec["id"]);
$this->setTableId($rec["table_id"]);
$this->setTitle($rec["title"]);
$this->setDescription($rec["description"]);
$this->setDatatypeId($rec["datatype_id"]);
$this->setRequired($rec["required"]);
$this->setUnique($rec["is_unique"]);
$this->setLocked($rec["is_locked"]);
}

+ Here is the call graph for this function:

ilDataCollectionField::checkValidity (   $value,
  $record_id = NULL 
)

Definition at line 907 of file class.ilDataCollectionField.php.

References ilDataCollectionDatatype\checkValidity(), getDatatypeId(), getPropertyvalues(), ilDataCollectionCache\getTableCache(), getTableId(), ilDataCollectionDatatype\INPUTFORMAT_DATETIME, ilDataCollectionDatatype\INPUTFORMAT_TEXT, isUnique(), ilDataCollectionInputException\LENGTH_EXCEPTION, ilDataCollectionInputException\NOT_URL, PROPERTYID_LENGTH, PROPERTYID_REGEX, PROPERTYID_URL, ilDataCollectionInputException\REGEX_EXCEPTION, ilDataCollectionInputException\TYPE_EXCEPTION, and ilDataCollectionInputException\UNIQUE_EXCEPTION.

{
//Don't check empty values
if ($value == NULL) {
return true;
}
}
$properties = $this->getPropertyvalues();
$regex = $properties[$regex_id];
if (substr($regex, 0, 1) != "/") {
$regex = "/" . $regex;
}
if (substr($regex, - 1) != "/") {
$regex .= "/";
}
if ($properties[$length] < mb_strlen($value, 'UTF-8') AND is_numeric($properties[$length])) {
}
if (!($properties[$regex_id] == NULL OR @preg_match($regex, $value))) {
}
//email or url
if ($properties[$url]
&& !(preg_match('~(^(news|(ht|f)tp(s?)\://){1}\S+)~i', $value)
|| preg_match("/^[a-z0-9!#$%&'*+=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i", $value))
) {
}
}
if ($this->isUnique() && $record_id === NULL) {
foreach ($table->getRecords() as $record) {
if ($record->getRecordFieldValue($this->getId()) == $value && ($record->getId() != $record_id || $record_id == 0)) {
}
//for text it has to be case insensitive.
if (strtolower($record->getRecordFieldValue($this->getId())) == strtolower($value)
&& ($record->getId() != $record_id
|| $record_id == 0)
) {
}
}
$datestring = $value["date"] . " " . $value["time"];//["y"]."-".$value["date"]['m']."-".$value["date"]['d']." 00:00:00";
if ($record->getRecordFieldValue($this->getId()) == $datestring && ($record->getId() != $record_id || $record_id == 0)) {
}
}
}
}
return true;
}

+ Here is the call graph for this function:

ilDataCollectionField::cloneProperties ( ilDataCollectionField  $originalField)
Parameters
ilDataCollectionField$originalField

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

References $id, getDatatypeId(), getId(), getProperties(), ilDataCollectionDatatype\INPUTFORMAT_REFERENCE, and PROPERTYID_REFERENCE.

Referenced by cloneStructure().

{
$orgProps = $originalField->getProperties();
if ($orgProps == NULL) {
return;
}
foreach ($orgProps as $id => $value) {
$fieldprop_obj = new ilDataCollectionFieldProp();
$fieldprop_obj->setDatatypePropertyId($id);
$fieldprop_obj->setFieldId($this->getId());
// If reference field, we must reset the referenced field, otherwise it will point to the old ID
) {
$value = NULL;
}
$fieldprop_obj->setValue($value);
$fieldprop_obj->doCreate();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionField::cloneStructure (   $original_id)
Parameters
$original_id
Exceptions
ilException

Definition at line 983 of file class.ilDataCollectionField.php.

References cloneProperties(), doCreate(), ilDataCollectionCache\getFieldCache(), setDatatypeId(), setDescription(), setEditable(), setExportable(), setFilterable(), setLocked(), setOrder(), setRequired(), setTitle(), setUnique(), and setVisible().

{
$original = ilDataCollectionCache::getFieldCache($original_id);
$this->setTitle($original->getTitle());
$this->setDatatypeId($original->getDatatypeId());
$this->setDescription($original->getDescription());
$this->setEditable($original->isEditable());
$this->setLocked($original->getLocked());
$this->setFilterable($original->isFilterable());
$this->setVisible($original->isVisible());
$this->setOrder($original->getOrder());
$this->setRequired($original->getRequired());
$this->setUnique($original->isUnique());
$this->setExportable($original->getExportable());
$this->doCreate();
$this->cloneProperties($original);
}

+ Here is the call graph for this function:

ilDataCollectionField::deleteViewDefinition (   $view)
private

Definition at line 762 of file class.ilDataCollectionField.php.

References $ilDB, $query, getId(), and getTableId().

Referenced by doDelete().

{
global $ilDB;
$query = "DELETE def FROM il_dcl_viewdefinition def INNER JOIN il_dcl_view ON il_dcl_view.type = " . $ilDB->quote($view, "integer")
. " AND il_dcl_view.table_id = " . $ilDB->quote($this->getTableId(), "integer") . " WHERE def.view_id = il_dcl_view.id AND def.field = "
. $ilDB->quote($this->getId(), "text");
$ilDB->manipulate($query);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionField::doCreate ( )

Create new field.

Reimplemented in ilDataCollectionStandardField.

Definition at line 604 of file class.ilDataCollectionField.php.

References $id, $ilDB, $query, ilDataCollectionTable\_tableExists(), getDatatypeId(), getDescription(), getId(), getLocked(), getRequired(), getTableId(), getTitle(), isUnique(), setId(), setLocked(), updateEditability(), updateExportability(), updateFilterability(), and updateVisibility().

Referenced by cloneStructure().

{
global $ilDB;
$this->getLocked() == NULL ? $this->setLocked(false) : true;
throw new ilException("The field does not have a related table!");
}
$id = $ilDB->nextId("il_dcl_field");
$this->setId($id);
$query = "INSERT INTO il_dcl_field (" . "id" . ", table_id" . ", datatype_id" . ", title" . ", description" . ", required" . ", is_unique"
. ", is_locked" . " ) VALUES (" . $ilDB->quote($this->getId(), "integer") . "," . $ilDB->quote($this->getTableId(), "integer") . ","
. $ilDB->quote($this->getDatatypeId(), "integer") . "," . $ilDB->quote($this->getTitle(), "text") . ","
. $ilDB->quote($this->getDescription(), "text") . "," . $ilDB->quote($this->getRequired(), "integer") . ","
. $ilDB->quote($this->isUnique(), "integer") . "," . $ilDB->quote($this->getLocked() ? 1 : 0, "integer") . ")";
$ilDB->manipulate($query);
$this->updateVisibility();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionField::doDelete ( )

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

References $ilDB, $query, deleteViewDefinition(), and getId().

{
global $ilDB;
// delete viewdefinitions.
$this->deleteViewDefinition(self::VIEW_VIEW);
$this->deleteViewDefinition(self::FILTER_VIEW);
$this->deleteViewDefinition(self::EDIT_VIEW);
$this->deleteViewDefinition(self::EXPORTABLE_VIEW);
$query = "DELETE FROM il_dcl_field_prop WHERE field_id = " . $ilDB->quote($this->getId(), "text");
$ilDB->manipulate($query);
$query = "DELETE FROM il_dcl_field WHERE id = " . $ilDB->quote($this->getId(), "text");
$ilDB->manipulate($query);
}

+ Here is the call graph for this function:

ilDataCollectionField::doRead ( )

Read field.

Reimplemented in ilDataCollectionStandardField.

Definition at line 567 of file class.ilDataCollectionField.php.

References $ilDB, $query, getId(), loadProperties(), setDatatypeId(), setDescription(), setLocked(), setRequired(), setTableId(), setTitle(), and setUnique().

Referenced by __construct().

{
global $ilDB;
//THEN 1 ELSE 0 END AS has_options FROM il_dcl_field f WHERE id = ".$ilDB->quote($this->getId(),"integer");
$query = "SELECT * FROM il_dcl_field WHERE id = " . $ilDB->quote($this->getId(), "integer");
$set = $ilDB->query($query);
$rec = $ilDB->fetchAssoc($set);
$this->setTableId($rec["table_id"]);
$this->setTitle($rec["title"]);
$this->setDescription($rec["description"]);
$this->setDatatypeId($rec["datatype_id"]);
$this->setRequired($rec["required"]);
$this->setUnique($rec["is_unique"]);
$this->setLocked($rec["is_locked"]);
$this->loadProperties();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionField::doUpdate ( )

Update field.

Reimplemented in ilDataCollectionStandardField.

Definition at line 631 of file class.ilDataCollectionField.php.

References $ilDB, getDatatypeId(), getDescription(), getId(), getLocked(), getRequired(), getTableId(), getTitle(), isUnique(), updateEditability(), updateExportability(), updateFilterability(), updateProperties(), and updateVisibility().

{
global $ilDB;
$ilDB->update("il_dcl_field", array(
"table_id" => array( "integer", $this->getTableId() ),
"datatype_id" => array( "text", $this->getDatatypeId() ),
"title" => array( "text", $this->getTitle() ),
"description" => array( "text", $this->getDescription() ),
"required" => array( "integer", $this->getRequired() ),
"is_unique" => array( "integer", $this->isUnique() ),
"is_locked" => array( "integer", $this->getLocked() ? 1 : 0 ),
), array(
"id" => array( "integer", $this->getId() )
));
$this->updateVisibility();
$this->updateProperties();
}

+ Here is the call graph for this function:

ilDataCollectionField::getDatatype ( )

Definition at line 357 of file class.ilDataCollectionField.php.

References $datatype, and loadDatatype().

{
$this->loadDatatype();
}

+ Here is the call graph for this function:

ilDataCollectionField::getDatatypeId ( )
ilDataCollectionField::getDatatypeTitle ( )

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

References loadDatatype().

Referenced by ilDataCollectionFieldListTableGUI\fillRow().

{
$this->loadDatatype();
return $this->datatype->getTitle();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionField::getDescription ( )

Get description.

Returns
string

Definition at line 232 of file class.ilDataCollectionField.php.

References $description.

Referenced by doCreate(), doUpdate(), ilDataCollectionFieldListTableGUI\fillRow(), and ilDataCollectionDatatype\getInputField().

{
}

+ Here is the caller graph for this function:

ilDataCollectionField::getExportable ( )

Definition at line 519 of file class.ilDataCollectionField.php.

References $exportable, and loadExportability().

Referenced by ilDataCollectionStandardField\cloneStructure(), ilDataCollectionFieldListTableGUI\fillRow(), and updateViewDefinition().

{
if (!isset($this->exportable)) {
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionField::getFieldRef ( )

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

References $id, getPropertyvalues(), and PROPERTYID_REFERENCE.

Referenced by ilDataCollectionDatatype\addFilterInputFieldToTable(), and ilDataCollectionFieldListTableGUI\fillRow().

{
$props = $this->getPropertyvalues();
return $props[$id];
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionField::getFieldReflist ( )

Definition at line 827 of file class.ilDataCollectionField.php.

References $id, getPropertyvalues(), and PROPERTYID_N_REFERENCE.

{
$props = $this->getPropertyvalues();
return $props[$id];
}

+ Here is the call graph for this function:

ilDataCollectionField::getFilterable ( )
Returns
bool returns the same as isFilterable.

Definition at line 672 of file class.ilDataCollectionField.php.

References isFilterable().

{
return $this->isFilterable();
}

+ Here is the call graph for this function:

ilDataCollectionField::getLearningProgress ( )
Returns
bool

Definition at line 389 of file class.ilDataCollectionField.php.

References getPropertyvalues(), and PROPERTYID_LEARNING_PROGRESS.

{
$props = $this->getPropertyvalues();
return $props[$p];
}

+ Here is the call graph for this function:

ilDataCollectionField::getLength ( )

Definition at line 367 of file class.ilDataCollectionField.php.

References getPropertyvalues(), and PROPERTYID_LENGTH.

Referenced by ilDataCollectionDatatype\getInputField().

{
$props = $this->getPropertyvalues();
return $props[$l];
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionField::getLocked ( )
Returns
boolean

Reimplemented in ilDataCollectionStandardField.

Definition at line 899 of file class.ilDataCollectionField.php.

References $locked.

Referenced by doCreate(), doUpdate(), and ilDataCollectionFieldListTableGUI\fillRow().

{
return $this->locked;
}

+ Here is the caller graph for this function:

ilDataCollectionField::getOrder ( )

Definition at line 796 of file class.ilDataCollectionField.php.

References $order, and loadVisibility().

Referenced by ilDataCollectionStandardField\cloneStructure(), and updateViewDefinition().

{
if (!isset($this->order)) {
$this->loadVisibility();
}
return !$this->order ? 0 : $this->order;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionField::getProperties ( )

Get all properties of a field.

Returns
array

Definition at line 874 of file class.ilDataCollectionField.php.

References $property, and loadProperties().

Referenced by ilDataCollectionILIASRefField\__construct(), ilDataCollectionFormulaField\__construct(), cloneProperties(), getTextArea(), and ilDataCollectionDatatype\passThroughFilter().

{
if ($this->property == NULL) {
$this->loadProperties();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionField::getPropertyvalues ( )

Get Property Values.

Parameters
int$a_id
Returns
array

Definition at line 317 of file class.ilDataCollectionField.php.

References $property, and loadProperties().

Referenced by checkValidity(), getFieldRef(), getFieldReflist(), getLearningProgress(), getLength(), and isNRef().

{
if ($this->property == NULL) {
$this->loadProperties();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionField::getRequired ( )

Get Required Required.

Returns
boolean

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

References $required.

Referenced by ilDataCollectionStandardField\cloneStructure(), doCreate(), doUpdate(), and ilDataCollectionFieldListTableGUI\fillRow().

{
}

+ Here is the caller graph for this function:

ilDataCollectionField::getStorageLocation ( )

Definition at line 410 of file class.ilDataCollectionField.php.

References loadDatatype().

{
$this->loadDatatype();
return $this->datatype->getStorageLocation();
}

+ Here is the call graph for this function:

ilDataCollectionField::getTableId ( )

Get table id.

Returns
int

Definition at line 188 of file class.ilDataCollectionField.php.

References $table_id.

Referenced by checkValidity(), deleteViewDefinition(), doCreate(), doUpdate(), and updateViewDefinition().

{
}

+ Here is the caller graph for this function:

ilDataCollectionField::getTextArea ( )
Returns
bool

Definition at line 378 of file class.ilDataCollectionField.php.

References $t, getProperties(), and PROPERTYID_TEXTAREA.

Referenced by ilDataCollectionDatatype\getInputField().

{
$props = $this->getProperties();
return $props[$t];
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionField::getTitle ( )

Get title.

Returns
string

Definition at line 212 of file class.ilDataCollectionField.php.

References $title.

Referenced by ilDataCollectionDatatype\addFilterInputFieldToTable(), doCreate(), doUpdate(), ilDataCollectionFieldListTableGUI\fillRow(), and ilDataCollectionDatatype\getInputField().

{
return $this->title;
}

+ Here is the caller graph for this function:

ilDataCollectionField::isEditable ( )

isEditable

Returns
int

Definition at line 502 of file class.ilDataCollectionField.php.

References $editable, and loadEditability().

Referenced by ilDataCollectionStandardField\cloneStructure(), and updateViewDefinition().

{
if (!isset($this->editable)) {
$this->loadEditability();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionField::isFilterable ( )
Returns
bool

Definition at line 446 of file class.ilDataCollectionField.php.

References $filterable, and loadFilterability().

Referenced by ilDataCollectionStandardField\cloneStructure(), ilDataCollectionFieldListTableGUI\fillRow(), getFilterable(), and updateViewDefinition().

{
if (!isset($this->filterable)) {
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionField::isNRef ( )
Returns
bool returns true iff this is a reference field AND the reference field has multiple input possibilities.

Definition at line 838 of file class.ilDataCollectionField.php.

References $id, getPropertyvalues(), and PROPERTYID_N_REFERENCE.

Referenced by ilDataCollectionDatatype\getInputField().

{
$props = $this->getPropertyvalues();
return $props[$id];
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionField::isStandardField ( )

Reimplemented in ilDataCollectionStandardField.

Definition at line 559 of file class.ilDataCollectionField.php.

Referenced by ilDataCollectionFieldListTableGUI\fillRow(), and getDatatypeId().

{
return false;
}

+ Here is the caller graph for this function:

ilDataCollectionField::isUnique ( )

Reimplemented in ilDataCollectionStandardField.

Definition at line 297 of file class.ilDataCollectionField.php.

References $unique.

Referenced by checkValidity(), doCreate(), doUpdate(), and ilDataCollectionFieldListTableGUI\fillRow().

{
return $this->unique;
}

+ Here is the caller graph for this function:

ilDataCollectionField::isVisible ( )
Returns
bool

Definition at line 427 of file class.ilDataCollectionField.php.

References $visible, and loadVisibility().

Referenced by ilDataCollectionStandardField\cloneStructure(), ilDataCollectionFieldListTableGUI\fillRow(), and updateViewDefinition().

{
if (!isset($this->visible)) {
$this->loadVisibility();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionField::loadDatatype ( )
protected

Definition at line 417 of file class.ilDataCollectionField.php.

Referenced by getDatatype(), getDatatypeTitle(), and getStorageLocation().

{
if ($this->datatype == NULL) {
$this->datatype = new ilDataCollectionDatatype($this->datatypeId);
}
}

+ Here is the caller graph for this function:

ilDataCollectionField::loadEditability ( )
private

Definition at line 531 of file class.ilDataCollectionField.php.

References loadViewDefinition().

Referenced by isEditable().

{
if ($this->editable == NULL) {
$this->loadViewDefinition(self::EDIT_VIEW);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionField::loadExportability ( )
private

Definition at line 541 of file class.ilDataCollectionField.php.

References loadViewDefinition().

Referenced by getExportable().

{
if ($this->exportable == NULL) {
$this->loadViewDefinition(self::EXPORTABLE_VIEW);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionField::loadFilterability ( )
protected

Definition at line 455 of file class.ilDataCollectionField.php.

References loadViewDefinition().

Referenced by isFilterable().

{
if ($this->filterable == NULL) {
$this->loadViewDefinition(self::FILTER_VIEW);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionField::loadProperties ( )
private

Get all properties of a field.

Returns
array

Definition at line 851 of file class.ilDataCollectionField.php.

References $ilDB, $query, getId(), and setPropertyvalue().

Referenced by doRead(), getProperties(), and getPropertyvalues().

{
global $ilDB;
$query = "SELECT datatype_prop_id,
title,
value
FROM il_dcl_field_prop fp
LEFT JOIN il_dcl_datatype_prop AS p ON p.id = fp.datatype_prop_id
WHERE fp.field_id = " . $ilDB->quote($this->getId(), "integer");
$set = $ilDB->query($query);
while ($rec = $ilDB->fetchAssoc($set)) {
$this->setPropertyvalue($rec['value'], $rec['datatype_prop_id']);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionField::loadViewDefinition (   $view)
protected

loadViewDefinition

Parameters
$viewint use VIEW_VIEW or EDIT_VIEW

Definition at line 467 of file class.ilDataCollectionField.php.

References $ilDB, and $query.

Referenced by loadEditability(), loadExportability(), loadFilterability(), and loadVisibility().

{
global $ilDB;
$query = " SELECT view.table_id, def.field_order, def.is_set FROM il_dcl_viewdefinition def
INNER JOIN il_dcl_view view ON view.id = def.view_id AND view.type = " . $ilDB->quote($view, "integer") . "
WHERE def.field LIKE '" . $this->id . "' AND view.table_id = " . $ilDB->quote($this->table_id, "integer");
$set = $ilDB->query($query);
$rec = $ilDB->fetchAssoc($set);
$prop = $rec['is_set'];
switch ($view) {
case self::VIEW_VIEW:
$this->visible = $prop;
break;
case self::EDIT_VIEW:
$this->editable = $prop;
break;
case self::FILTER_VIEW:
$this->filterable = $prop;
break;
case self::EXPORTABLE_VIEW:
$this->exportable = $prop;
break;
}
if (!$this->order) {
$this->order = $rec['field_order'];
}
}

+ Here is the caller graph for this function:

ilDataCollectionField::loadVisibility ( )
protected

Definition at line 436 of file class.ilDataCollectionField.php.

References loadViewDefinition().

Referenced by getOrder(), and isVisible().

{
if ($this->visible == NULL) {
$this->loadViewDefinition(self::VIEW_VIEW);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionField::setDatatypeId (   $a_id)

Set datatype id.

Parameters
int$a_id

Definition at line 242 of file class.ilDataCollectionField.php.

Referenced by buildFromDBRecord(), cloneStructure(), and doRead().

{
//unset the cached datatype.
$this->datatype = NULL;
$this->datatypeId = $a_id;
}

+ Here is the caller graph for this function:

ilDataCollectionField::setDescription (   $a_desc)

Set description.

Parameters
string$a_desc

Definition at line 222 of file class.ilDataCollectionField.php.

Referenced by buildFromDBRecord(), cloneStructure(), and doRead().

{
$this->description = $a_desc;
}

+ Here is the caller graph for this function:

ilDataCollectionField::setEditable (   $editable)

Definition at line 514 of file class.ilDataCollectionField.php.

References $editable.

Referenced by ilDataCollectionStandardField\cloneStructure(), and cloneStructure().

{
$this->editable = $editable;
}

+ Here is the caller graph for this function:

ilDataCollectionField::setExportable (   $exportable)
Parameters
boolean$exportable

Definition at line 1028 of file class.ilDataCollectionField.php.

References $exportable.

Referenced by ilDataCollectionStandardField\cloneStructure(), and cloneStructure().

{
$this->exportable = $exportable;
}

+ Here is the caller graph for this function:

ilDataCollectionField::setFilterable (   $filterable)

setFilterable

Parameters
$filterablebool

Definition at line 345 of file class.ilDataCollectionField.php.

References $filterable, and setOrder().

Referenced by ilDataCollectionStandardField\cloneStructure(), and cloneStructure().

{
if ($filterable == true && $this->order === NULL) {
$this->setOrder(0);
}
$this->filterable = $filterable;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionField::setId (   $a_id)

Set field id.

Parameters
int$a_id

Definition at line 158 of file class.ilDataCollectionField.php.

Referenced by buildFromDBRecord(), and doCreate().

{
$this->id = $a_id;
}

+ Here is the caller graph for this function:

ilDataCollectionField::setLocked (   $locked)
Parameters
boolean$locked

Definition at line 891 of file class.ilDataCollectionField.php.

References $locked.

Referenced by buildFromDBRecord(), ilDataCollectionStandardField\cloneStructure(), cloneStructure(), doCreate(), and doRead().

{
$this->locked = $locked;
}

+ Here is the caller graph for this function:

ilDataCollectionField::setOrder (   $order)

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

References $order.

Referenced by ilDataCollectionStandardField\cloneStructure(), cloneStructure(), setFilterable(), and setVisible().

{
$this->order = $order;
}

+ Here is the caller graph for this function:

ilDataCollectionField::setProperties (   $data)

Definition at line 883 of file class.ilDataCollectionField.php.

{
$this->property = $data;
}
ilDataCollectionField::setPropertyvalue (   $a_value,
  $a_id 
)

Set Property Value.

Parameters
string$a_value
int$a_id

Definition at line 289 of file class.ilDataCollectionField.php.

Referenced by loadProperties().

{
$this->property[$a_id] = $a_value;
}

+ Here is the caller graph for this function:

ilDataCollectionField::setRequired (   $a_required)

Set Required.

Parameters
boolean$a_requiredRequired

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

Referenced by buildFromDBRecord(), ilDataCollectionStandardField\cloneStructure(), cloneStructure(), and doRead().

{
$this->required = $a_required;
}

+ Here is the caller graph for this function:

ilDataCollectionField::setTableId (   $a_id)

Set table id.

Parameters
int$a_id

Definition at line 178 of file class.ilDataCollectionField.php.

Referenced by buildFromDBRecord(), and doRead().

{
$this->table_id = $a_id;
}

+ Here is the caller graph for this function:

ilDataCollectionField::setTitle (   $a_title)

Set title.

Parameters
string$a_title

Definition at line 198 of file class.ilDataCollectionField.php.

Referenced by buildFromDBRecord(), cloneStructure(), and doRead().

{
//title cannot begin with _ as this is saved for other purposes. make __ instead.
if (substr($a_title, 0, 1) == "_" && substr($a_title, 0, 2) != "__") {
$a_title = "_" . $a_title;
}
$this->title = $a_title;
}

+ Here is the caller graph for this function:

ilDataCollectionField::setUnique (   $unique)

Definition at line 305 of file class.ilDataCollectionField.php.

References $unique.

Referenced by buildFromDBRecord(), ilDataCollectionStandardField\cloneStructure(), cloneStructure(), and doRead().

{
$this->unique = $unique ? 1 : 0;
}

+ Here is the caller graph for this function:

ilDataCollectionField::setVisible (   $visible)

setVisible

Parameters
$visiblebool

Definition at line 331 of file class.ilDataCollectionField.php.

References $visible, and setOrder().

Referenced by ilDataCollectionStandardField\cloneStructure(), and cloneStructure().

{
if ($visible == true && $this->order === NULL) {
$this->setOrder(0);
}
$this->visible = $visible;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionField::toArray ( )

Definition at line 551 of file class.ilDataCollectionField.php.

{
return (array)$this;
}
ilDataCollectionField::updateEditability ( )
protected

Definition at line 693 of file class.ilDataCollectionField.php.

References updateViewDefinition().

Referenced by doCreate(), and doUpdate().

{
$this->updateViewDefinition(self::EDIT_VIEW);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionField::updateExportability ( )
protected

Definition at line 698 of file class.ilDataCollectionField.php.

References updateViewDefinition().

Referenced by doCreate(), ilDataCollectionStandardField\doUpdate(), and doUpdate().

{
$this->updateViewDefinition(self::EXPORTABLE_VIEW);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionField::updateFilterability ( )
protected

Definition at line 688 of file class.ilDataCollectionField.php.

References updateViewDefinition().

Referenced by doCreate(), ilDataCollectionStandardField\doUpdate(), and doUpdate().

{
$this->updateViewDefinition(self::FILTER_VIEW);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionField::updateProperties ( )
protected

Update properties of this field in Database.

Definition at line 656 of file class.ilDataCollectionField.php.

References $ilDB, and getId().

Referenced by doUpdate().

{
global $ilDB;
foreach ($this->property as $key => $value) {
$ilDB->update('il_dcl_field_prop', array(
'value' => array( 'integer', $value ),
), array(
'field_id' => array( 'integer', $this->getId() ),
'datatype_prop_id' => array( 'integer', $key ),
));
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionField::updateViewDefinition (   $view)
private

updateViewDefinition

Parameters
$viewint use constant VIEW_VIEW or EDIT_VIEW

Definition at line 708 of file class.ilDataCollectionField.php.

References $ilDB, $query, getExportable(), getId(), getOrder(), getTableId(), isEditable(), isFilterable(), and isVisible().

Referenced by updateEditability(), updateExportability(), updateFilterability(), and updateVisibility().

{
global $ilDB;
switch ($view) {
case self::EDIT_VIEW:
$set = $this->isEditable();
break;
case self::VIEW_VIEW:
$set = $this->isVisible();
if ($set && $this->order === NULL) {
$this->order = 0;
}
break;
case self::FILTER_VIEW:
$set = $this->isFilterable();
if ($set && $this->order === NULL) {
$this->order = 0;
}
break;
case self::EXPORTABLE_VIEW:
$set = $this->getExportable();
if ($set && $this->order === NULL) {
$this->order = 0;
}
break;
}
if (!$set) {
$set = 0;
} else {
$set = 1;
}
if (!isset($this->order)) {
$this->order = 0;
}
$query = "DELETE def FROM il_dcl_viewdefinition def INNER JOIN il_dcl_view ON il_dcl_view.type = " . $ilDB->quote($view, "integer")
. " AND il_dcl_view.table_id = " . $ilDB->quote($this->getTableId(), "integer") . " WHERE def.view_id = il_dcl_view.id AND def.field = "
. $ilDB->quote($this->getId(), "text");
$ilDB->manipulate($query);
$query = "INSERT INTO il_dcl_viewdefinition (view_id, field, field_order, is_set) SELECT id, " . $ilDB->quote($this->getId(), "text") . ", "
. $ilDB->quote($this->getOrder(), "integer") . ", " . $ilDB->quote($set, "integer") . " FROM il_dcl_view WHERE il_dcl_view.type = "
. $ilDB->quote($view, "integer") . " AND il_dcl_view.table_id = " . $ilDB->quote($this->getTableId(), "integer");
$ilDB->manipulate($query);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionField::updateVisibility ( )
protected

Definition at line 680 of file class.ilDataCollectionField.php.

References updateViewDefinition().

Referenced by doCreate(), ilDataCollectionStandardField\doUpdate(), and doUpdate().

{
$this->updateViewDefinition(self::VIEW_VIEW);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilDataCollectionField::$datatype
protected
ilDataCollectionField::$datatypeId
protected

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

Referenced by getDatatypeId().

ilDataCollectionField::$description
protected

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

Referenced by getDescription().

ilDataCollectionField::$editable
protected

Definition at line 60 of file class.ilDataCollectionField.php.

Referenced by isEditable(), and setEditable().

ilDataCollectionField::$exportable
protected

Definition at line 76 of file class.ilDataCollectionField.php.

Referenced by getExportable(), and setExportable().

ilDataCollectionField::$filterable
protected

Definition at line 64 of file class.ilDataCollectionField.php.

Referenced by isFilterable(), and setFilterable().

ilDataCollectionField::$locked
protected

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

Referenced by getLocked(), and setLocked().

ilDataCollectionField::$order
protected

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

Referenced by getOrder(), and setOrder().

ilDataCollectionField::$property = array()
protected

Definition at line 72 of file class.ilDataCollectionField.php.

Referenced by getProperties(), and getPropertyvalues().

ilDataCollectionField::$required
protected

Definition at line 44 of file class.ilDataCollectionField.php.

Referenced by getRequired().

ilDataCollectionField::$table_id
protected
ilDataCollectionField::$title
protected

Definition at line 32 of file class.ilDataCollectionField.php.

Referenced by _getFieldIdByTitle(), and getTitle().

ilDataCollectionField::$unique
protected

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

Referenced by isUnique(), and setUnique().

ilDataCollectionField::$visible
protected

Definition at line 56 of file class.ilDataCollectionField.php.

Referenced by isVisible(), and setVisible().

const ilDataCollectionField::EDIT_VIEW = 2

Definition at line 102 of file class.ilDataCollectionField.php.

Referenced by ilDataCollectionTable\doCreate().

const ilDataCollectionField::EXPORTABLE_VIEW = 4

Definition at line 104 of file class.ilDataCollectionField.php.

Referenced by ilDataCollectionTable\doCreate().

const ilDataCollectionField::FILTER_VIEW = 3

Definition at line 103 of file class.ilDataCollectionField.php.

Referenced by ilDataCollectionTable\doCreate().

const ilDataCollectionField::PROPERTYID_DISPLAY_COPY_LINK_ACTION_MENU = 13
const ilDataCollectionField::PROPERTYID_FORMULA_EXPRESSION = 12
const ilDataCollectionField::PROPERTYID_HEIGHT = 8
const ilDataCollectionField::PROPERTYID_ILIAS_REFERENCE_LINK = 10
const ilDataCollectionField::PROPERTYID_LEARNING_PROGRESS = 9

Definition at line 92 of file class.ilDataCollectionField.php.

Referenced by getLearningProgress().

const ilDataCollectionField::PROPERTYID_LENGTH = 1
const ilDataCollectionField::PROPERTYID_LINK_DETAIL_PAGE_MOB = 15

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

Referenced by ilDataCollectionDatatype\parseHTML().

const ilDataCollectionField::PROPERTYID_LINK_DETAIL_PAGE_TEXT = 14

Definition at line 97 of file class.ilDataCollectionField.php.

Referenced by ilDataCollectionDatatype\parseHTML().

const ilDataCollectionField::PROPERTYID_REFERENCE = 3
const ilDataCollectionField::PROPERTYID_REFERENCE_LINK = 6

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

const ilDataCollectionField::PROPERTYID_REGEX = 2

Definition at line 82 of file class.ilDataCollectionField.php.

Referenced by checkValidity().

const ilDataCollectionField::PROPERTYID_SUPPORTED_FILE_TYPES = 16

Definition at line 99 of file class.ilDataCollectionField.php.

const ilDataCollectionField::PROPERTYID_TEXTAREA = 5
const ilDataCollectionField::PROPERTYID_URL = 4
const ilDataCollectionField::PROPERTYID_WIDTH = 7
const ilDataCollectionField::VIEW_VIEW = 1

Definition at line 101 of file class.ilDataCollectionField.php.

Referenced by ilDataCollectionTable\doCreate().


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