ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilDataCollectionStandardField Class Reference

Class ilDataCollectionField. More...

+ Inheritance diagram for ilDataCollectionStandardField:
+ Collaboration diagram for ilDataCollectionStandardField:

Public Member Functions

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

Static Public Member Functions

static _getStandardFieldsAsArray ()
 
static _getStandardFields ($table_id)
 
static _isStandardField ($field_id)
 
static _getDatatypeForId ($id)
 gives you the datatype id of a specified standard field. More...
 
- Static Public Member Functions inherited from ilDataCollectionField
static _getTitleValidChars ($a_as_regex=true)
 All valid chars for filed titles. More...
 
static _getFieldIdByTitle ($title, $table_id)
 

Additional Inherited Members

- Data Fields inherited from ilDataCollectionField
const PROPERTYID_LENGTH = 1
 
const PROPERTYID_REGEX = 2
 
const PROPERTYID_REFERENCE = 3
 
const PROPERTYID_REFERENCELIST = 11
 
const PROPERTYID_URL = 4
 LINK OR EMAIL! More...
 
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 VIEW_VIEW = 1
 
const EDIT_VIEW = 2
 
const FILTER_VIEW = 3
 
const EXPORTABLE_VIEW = 4
 
- Protected Member Functions inherited from ilDataCollectionField
 updateProperties ()
 Update properties of this field in Database. More...
 
 updateVisibility ()
 
 updateFilterability ()
 
 updateEditability ()
 
 updateExportability ()
 
- Protected Attributes inherited from ilDataCollectionField
 $id
 
 $table_id
 
 $title
 
 $description
 
 $datatypeId
 
 $required
 
 $order
 
 $unique
 
 $visible
 
 $editable
 
 $filterable
 
 $locked
 
 $property = array()
 
 $exportable
 
 $datatype
 

Detailed Description

Member Function Documentation

◆ _getDatatypeForId()

static ilDataCollectionStandardField::_getDatatypeForId (   $id)
static

gives you the datatype id of a specified standard field.

Parameters
$idthe id of the standardfield eg. "create_date"

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

References ilDataCollectionField\$id, ilDataCollectionDatatype\INPUTFORMAT_DATETIME, ilDataCollectionDatatype\INPUTFORMAT_NUMBER, and ilDataCollectionDatatype\INPUTFORMAT_TEXT.

Referenced by ilDataCollectionField\getDatatypeId().

117  {
118  switch($id)
119  {
120  case 'id':
122  case 'owner';
124  case 'create_date':
126  case 'last_edit_by':
128  case 'table_id':
130  case 'last_update':
132  }
133  return NULL;
134  }
+ Here is the caller graph for this function:

◆ _getStandardFields()

static ilDataCollectionStandardField::_getStandardFields (   $table_id)
static

Definition at line 81 of file class.ilDataCollectionStandardField.php.

References ilDataCollectionField\$table_id.

Referenced by ilDataCollectionTable\getFields(), and ilDataCollectionTable\getStandardFields().

82  {
83  $stdFields = array();
84  foreach(self::_getStandardFieldsAsArray() as $array)
85  {
86  $array["table_id"] = $table_id;
87  $array["datatype_id"] = self::_getDatatypeForId($array["id"]);
88  $field = new ilDataCollectionStandardField();
89  $field->buildFromDBRecord($array);
90  array_push($stdFields, $field);
91  }
92  return $stdFields;
93  }
+ Here is the caller graph for this function:

◆ _getStandardFieldsAsArray()

static ilDataCollectionStandardField::_getStandardFieldsAsArray ( )
static

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

References $lng, ilDataCollectionDatatype\INPUTFORMAT_DATETIME, ilDataCollectionDatatype\INPUTFORMAT_NUMBER, and ilDataCollectionDatatype\INPUTFORMAT_TEXT.

64  {
65 
66  //TODO: this isn't particularly pretty especially as $lng is used in the model. On the long run the standard fields should be refactored into "normal" fields.
67  global $lng;
68  $stdfields = array(
69  array("id"=>"id", "title" => $lng->txt("dcl_id"), "description" => $lng->txt("dcl_id_description"), "datatype_id" => ilDataCollectionDatatype::INPUTFORMAT_NUMBER, "required" => true),
70  array("id"=>"create_date", "title" => $lng->txt("dcl_creation_date"), "description" => $lng->txt("dcl_creation_date_description"), "datatype_id" => ilDataCollectionDatatype::INPUTFORMAT_DATETIME, "required" => true),
71  array("id"=>"last_update", "title" => $lng->txt("dcl_last_update"), "description" => $lng->txt("dcl_last_update_description"), "datatype_id" => ilDataCollectionDatatype::INPUTFORMAT_DATETIME, "required" => true),
72  array("id"=>"owner", "title" => $lng->txt("dcl_owner"), "description" => $lng->txt("dcl_owner_description"), "datatype_id" => ilDataCollectionDatatype::INPUTFORMAT_TEXT, "required" => true),
73  array("id"=>"last_edit_by", "title" => $lng->txt("dcl_last_edited_by"), "description" => $lng->txt("dcl_last_edited_by_description"), "datatype_id" => ilDataCollectionDatatype::INPUTFORMAT_TEXT, "required" => true)
74  );
75  return $stdfields;
76  }
global $lng
Definition: privfeed.php:40

◆ _isStandardField()

static ilDataCollectionStandardField::_isStandardField (   $field_id)
static

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

Referenced by ilDataCollectionRecord\getRecordFieldExportValue(), ilDataCollectionRecord\getRecordFieldFormInput(), ilDataCollectionRecord\getRecordFieldHTML(), ilDataCollectionRecord\getRecordFieldSingleHTML(), ilDataCollectionRecord\getRecordFieldValue(), and ilDataCollectionRecord\setRecordFieldValue().

99  {
100  $return = false;
101  foreach(self::_getStandardFieldsAsArray() as $field)
102  {
103  if($field["id"] == $field_id)
104  {
105  $return = true;
106  }
107  }
108 
109  return $return;
110  }
+ Here is the caller graph for this function:

◆ doCreate()

ilDataCollectionStandardField::doCreate ( )

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

References $ilLog, and ilUtil\sendFailure().

35  {
36  global $ilLog;
37  $message = "Standard fields cannot be written to DB";
38  ilUtil::sendFailure($message);
39  $ilLog->write("[ilDataCollectionStandardField] ".$message);
40  }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ doRead()

ilDataCollectionStandardField::doRead ( )

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

References $ilLog, and ilUtil\sendFailure().

24  {
25  global $ilLog;
26  $message = "Standard fields cannot be read from DB";
27  ilUtil::sendFailure($message);
28  $ilLog->write("[ilDataCollectionStandardField] ".$message);
29  }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ doUpdate()

ilDataCollectionStandardField::doUpdate ( )

◆ getLocked()

ilDataCollectionStandardField::getLocked ( )

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

56  {
57  return true;
58  }

◆ isStandardField()

ilDataCollectionStandardField::isStandardField ( )

Definition at line 139 of file class.ilDataCollectionStandardField.php.

140  {
141  return true;
142  }

◆ isUnique()

ilDataCollectionStandardField::isUnique ( )

Definition at line 147 of file class.ilDataCollectionStandardField.php.

148  {
149  return false;
150  }

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