ILIAS  release_4-3 Revision
 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)
 Constructor public.
 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)
 toArray ()
 isStandardField ()
 doRead ()
 Read field.
 buildFromDBRecord ($rec)
 doCreate ()
 Create new field.
 doUpdate ()
 Update field.
 doDelete ()
 getOrder ()
 setOrder ($order)
 getFieldRef ()
 getProperties ()
 Get all properties of a field.
 setProperties ($data)
 setLocked ($locked)
 getLocked ()
 checkValidity ($value, $record_id=null)
 cloneStructure ($original_id)
 cloneProperties ($originalField)

Static Public Member Functions

static _getTitleValidChars ($a_as_regex=true)
 All valid chars for field 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 VIEW_VIEW = 1
const EDIT_VIEW = 2
const FILTER_VIEW = 3

Protected Member Functions

 updateProperties ()
 Update properties of this field in Database.
 updateVisibility ()
 updateFilterability ()
 updateEditability ()

Protected Attributes

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

Private Member Functions

 loadDatatype ()
 loadVisibility ()
 loadFilterability ()
 loadViewDefinition ($view)
 loadViewDefinition
 loadEditability ()
 updateViewDefinition ($view)
 updateViewDefinition
 deleteViewDefinition ($view)
 loadProperties ()
 Get all properties of a field.

Detailed Description

Constructor & Destructor Documentation

ilDataCollectionField::__construct (   $a_id = 0)

Constructor public.

Parameters
integerfiel_id

Definition at line 117 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 151 of file class.ilDataCollectionField.php.

References $id, $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 field titles.

Parameters
bool$a_as_regex
Returns
string

Definition at line 133 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 584 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 880 of file class.ilDataCollectionField.php.

References ilDataCollectionDatatype\checkValidity(), getDatatypeId(), ilObjMediaObject\getMimeType(), getPropertyvalues(), ilDataCollectionCache\getTableCache(), getTableId(), ilDataCollectionDatatype\INPUTFORMAT_DATETIME, ilDataCollectionDatatype\INPUTFORMAT_MOB, ilDataCollectionDatatype\INPUTFORMAT_TEXT, isUnique(), ilDataCollectionInputException\LENGTH_EXCEPTION, ilDataCollectionInputException\NOT_IMAGE, 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] < strlen($value) && is_numeric($properties[$length]))
if(!($properties[$regex_id] == NULL || @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->getDatatypeId() == ilDataCollectionDatatype::INPUTFORMAT_MOB AND $value['name'])
{
$arrMimeType = explode('/', ilObjMediaObject::getMimeType($value['name']));
if($arrMimeType[0] != "image") {
}
}
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 (   $originalField)
Parameters
$originalFieldilDataCollectionField

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

References $id, getId(), 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)

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

References cloneProperties(), doCreate(), ilDataCollectionCache\getFieldCache(), setDatatypeId(), setDescription(), setEditable(), 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->doCreate();
$this->cloneProperties($original);
}

+ Here is the call graph for this function:

ilDataCollectionField::deleteViewDefinition (   $view)
private

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

References $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 599 of file class.ilDataCollectionField.php.

References $id, $query, ilDataCollectionTable\_tableExists(), getDatatypeId(), getDescription(), getId(), getLocked(), getRequired(), getTableId(), getTitle(), isUnique(), setId(), setLocked(), updateEditability(), 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 771 of file class.ilDataCollectionField.php.

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

{
global $ilDB;
// delete viewdefinitions.
$this->deleteViewDefinition(self::VIEW_VIEW);
$this->deleteViewDefinition(self::FILTER_VIEW);
$this->deleteViewDefinition(self::EDIT_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 562 of file class.ilDataCollectionField.php.

References $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 638 of file class.ilDataCollectionField.php.

References getDatatypeId(), getDescription(), getId(), getLocked(), getRequired(), getTableId(), getTitle(), isUnique(), updateEditability(), 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 361 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 402 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 239 of file class.ilDataCollectionField.php.

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

{
return $this->desc;
}

+ Here is the caller graph for this function:

ilDataCollectionField::getFieldRef ( )

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

References $id, getPropertyvalues(), and PROPERTYID_REFERENCE.

Referenced by ilDataCollectionDatatype\addFilterInputFieldToTable().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionField::getLearningProgress ( )
Returns
bool

Definition at line 392 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 371 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 872 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 791 of file class.ilDataCollectionField.php.

References $order, and loadVisibility().

Referenced by 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 849 of file class.ilDataCollectionField.php.

References $property, and loadProperties().

Referenced by getTextArea().

{
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 323 of file class.ilDataCollectionField.php.

References $property, and loadProperties().

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

{
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 285 of file class.ilDataCollectionField.php.

References $required.

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

{
}

+ Here is the caller graph for this function:

ilDataCollectionField::getStorageLocation ( )

Definition at line 412 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 196 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 382 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 219 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 514 of file class.ilDataCollectionField.php.

References $editable, and loadEditability().

Referenced by 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 ( )

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

References $filterable, and loadFilterability().

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

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionField::isStandardField ( )

Reimplemented in ilDataCollectionStandardField.

Definition at line 554 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 304 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 ( )

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

References $visible, and loadVisibility().

Referenced by 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 ( )
private

Definition at line 422 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 535 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::loadFilterability ( )
private

Definition at line 470 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 825 of file class.ilDataCollectionField.php.

References $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)
private

loadViewDefinition

Parameters
$viewuse VIEW_VIEW or EDIT_VIEW

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

References $query.

Referenced by loadEditability(), 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;
}
if(!$this->order)
$this->order = $rec['field_order'];
}

+ Here is the caller graph for this function:

ilDataCollectionField::loadVisibility ( )
private

Definition at line 446 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 249 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 229 of file class.ilDataCollectionField.php.

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

{
$this->desc = $a_desc;
}

+ Here is the caller graph for this function:

ilDataCollectionField::setEditable (   $editable)

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

References $editable.

Referenced by cloneStructure().

{
$this->editable = $editable;
}

+ Here is the caller graph for this function:

ilDataCollectionField::setFilterable (   $filterable)

setFilterable

Parameters
$filterablebool

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

References $filterable, and setOrder().

Referenced by 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 166 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 864 of file class.ilDataCollectionField.php.

References $locked.

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

{
$this->locked = $locked;
}

+ Here is the caller graph for this function:

ilDataCollectionField::setOrder (   $order)

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

References $order.

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

{
$this->order = $order;
}

+ Here is the caller graph for this function:

ilDataCollectionField::setProperties (   $data)

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

References $data.

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

Set Property Value.

Parameters
string$a_value
int$a_id

Definition at line 296 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 275 of file class.ilDataCollectionField.php.

Referenced by buildFromDBRecord(), 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 186 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 206 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 312 of file class.ilDataCollectionField.php.

References $unique.

Referenced by buildFromDBRecord(), 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 334 of file class.ilDataCollectionField.php.

References $visible, and setOrder().

Referenced by 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 546 of file class.ilDataCollectionField.php.

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

Definition at line 698 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::updateFilterability ( )
protected

Definition at line 693 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 662 of file class.ilDataCollectionField.php.

References 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
$viewuse constant VIEW_VIEW or EDIT_VIEW

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

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

Referenced by updateEditability(), 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;
}
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 685 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

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

Referenced by getDatatype().

ilDataCollectionField::$datatypeId
protected

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

Referenced by getDatatypeId().

ilDataCollectionField::$description
protected

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

ilDataCollectionField::$editable
protected

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

Referenced by isEditable(), and setEditable().

ilDataCollectionField::$filterable
protected

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

Referenced by isFilterable(), and setFilterable().

ilDataCollectionField::$locked
protected

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

Referenced by getLocked(), and setLocked().

ilDataCollectionField::$order
protected

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

Referenced by getOrder(), and setOrder().

ilDataCollectionField::$property = array()
protected

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

Referenced by getProperties(), and getPropertyvalues().

ilDataCollectionField::$required
protected

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

Referenced by getRequired().

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

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

Referenced by _getFieldIdByTitle(), and getTitle().

ilDataCollectionField::$unique
protected

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

Referenced by isUnique(), and setUnique().

ilDataCollectionField::$visible
protected

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

Referenced by isVisible(), and setVisible().

const ilDataCollectionField::EDIT_VIEW = 2

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

Referenced by ilDataCollectionTable\doCreate().

const ilDataCollectionField::FILTER_VIEW = 3

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

Referenced by ilDataCollectionTable\doCreate().

const ilDataCollectionField::PROPERTYID_HEIGHT = 8
const ilDataCollectionField::PROPERTYID_ILIAS_REFERENCE_LINK = 10
const ilDataCollectionField::PROPERTYID_LEARNING_PROGRESS = 9

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

Referenced by getLearningProgress().

const ilDataCollectionField::PROPERTYID_LENGTH = 1
const ilDataCollectionField::PROPERTYID_REFERENCE = 3
const ilDataCollectionField::PROPERTYID_REFERENCE_LINK = 6
const ilDataCollectionField::PROPERTYID_REGEX = 2

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

Referenced by checkValidity().

const ilDataCollectionField::PROPERTYID_TEXTAREA = 5
const ilDataCollectionField::PROPERTYID_URL = 4

LINK OR EMAIL!

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

Referenced by checkValidity(), and ilDataCollectionDatatype\parseHTML().

const ilDataCollectionField::PROPERTYID_WIDTH = 7
const ilDataCollectionField::VIEW_VIEW = 1

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

Referenced by ilDataCollectionTable\doCreate().


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