41        if (!is_array($values)) {
 
   42            $values = array($values);
 
   44        $datatype = $this->
getField()->getDatatype();
 
   46        $query = 
"DELETE FROM il_dcl_stloc" . $datatype->getStorageLocation() . 
"_value WHERE record_field_id = " 
   47            . 
$ilDB->quote($this->
id, 
"integer");
 
   50        if (!count($values) || $values[0] == 0) {
 
   54        $query = 
"INSERT INTO il_dcl_stloc" . $datatype->getStorageLocation() . 
"_value (value, record_field_id, id) VALUES";
 
   55        foreach ($values as 
$value) {
 
   56            $next_id = 
$ilDB->nextId(
"il_dcl_stloc" . $datatype->getStorageLocation() . 
"_value");
 
   58                . 
$ilDB->quote($next_id, 
"integer") . 
"),";
 
   78        if ($this->value === 
null) {
 
   81            $datatype = $this->
getField()->getDatatype();
 
   84            $supported_internal_types = array(
 
   90            $supported_types = array_merge(
 
   96                $supported_internal_types
 
   98            $datatypeId = $refField->getDatatypeId();
 
   99            if (in_array($datatypeId, $supported_types)) {
 
  100                if (in_array($datatypeId, $supported_internal_types)) {
 
  101                    $query = 
"SELECT stlocOrig.value AS value,  ilias_object.title AS value_ref ";
 
  103                    $query = 
"SELECT stlocOrig.value AS value,  stlocRef.value AS value_ref ";
 
  105                $query .= 
"FROM il_dcl_stloc" . $datatype->getStorageLocation() . 
"_value AS stlocOrig  ";
 
  107                $query .= 
" INNER JOIN il_dcl_record_field AS refField ON stlocOrig.value = refField.record_id AND refField.field_id = " 
  108                    . 
$ilDB->quote($refField->getId(), 
"integer");
 
  109                $query .= 
" INNER JOIN il_dcl_stloc" . $refField->getStorageLocation()
 
  110                    . 
"_value AS stlocRef ON stlocRef.record_field_id = refField.id ";
 
  112                $query = 
"SELECT stlocOrig.value AS value ";
 
  113                $query .= 
"FROM il_dcl_stloc" . $datatype->getStorageLocation() . 
"_value AS stlocOrig  ";
 
  116            switch ($datatypeId) {
 
  118                    $query .= 
" INNER JOIN object_reference AS ilias_ref ON ilias_ref.ref_id = stlocRef.value ";
 
  119                    $query .= 
" INNER JOIN object_data AS ilias_object ON ilias_object.obj_id = ilias_ref.obj_id ";
 
  123                    $query .= 
" INNER JOIN object_data AS ilias_object ON ilias_object.obj_id =  stlocRef.value ";
 
  126            $query .= 
" WHERE stlocOrig.record_field_id = " . 
$ilDB->quote($this->
id, 
"integer");
 
  127            if (in_array($datatypeId, $supported_types)) {
 
  128                $query .= 
" ORDER BY value_ref ASC";
 
  133            $this->value = array();
 
  134            while ($rec = 
$ilDB->fetchAssoc($set)) {
 
  135                $this->value[] = $rec[
'value'];
 
  143        if ($this->value === 
null) {
 
  146            $datatype = $this->
getField()->getDatatype();
 
  147            $query = 
"SELECT * FROM il_dcl_stloc" . $datatype->getStorageLocation() . 
"_value WHERE record_field_id = " 
  148                . 
$ilDB->quote($this->
id, 
"integer");
 
  150            $this->value = array();
 
  151            while ($rec = 
$ilDB->fetchAssoc($set)) {
 
  152                $this->value[] = $rec[
'value'];
 
  167        return $ilDataCollectionNReferenceFieldGUI->getSingleHTML($options);
 
  179        if ($link == 
"[" . $this->
getField()->getTitle() . 
"]") {
 
  183        return parent::getLinkHTML($link, 
$value);
 
  194        return $ilDataCollectionNReferenceFieldGUI->getHTML();
 
  202        $stringValue = parent::getValueFromExcel($excel, $row, $col);
 
  205        if (!count($referenceIds) && $stringValue) {
 
  209            return array(
'warning' => $warning);
 
  212        return $referenceIds;
 
  223        foreach ($values as 
$value) {
 
  226                $names[] = $ref_rec->getRecordField($this->
getField()->getFieldRef())->getValue();
 
  230        foreach ($names as 
$name) {
 
  231            $string .= 
$name . 
", ";
 
  233        if (!count($names)) {
 
  236        $string = substr($string, 0, -2);
 
  253        $slicedStrings = explode(
", ", $stringValues);
 
  254        $slicedReferences = array();
 
  256        for (
$i = 0; 
$i < count($slicedStrings); 
$i++) {
 
  259            $searchString = implode(array_slice($slicedStrings, $resolved, 
$i - $resolved + 1));
 
  261                $slicedReferences[] = $ref;
 
  268            $searchString = $slicedStrings[
$i];
 
  270                $slicedReferences[] = $ref;
 
  276        return $slicedReferences;
 
An exception for terminatinating execution or to throw for unit testing.
static getExcelCharForInteger($int)
static getRecordCache($record_id=0)
static getFieldCache($field_id=0)
const INPUTFORMAT_ILIAS_REF
const INPUTFORMAT_BOOLEAN
Class ilDclNReferenceFieldGUI.
getSingleHTML($options=null)
@description this funciton is used to in the viewdefinition of a single record.
doUpdate()
Update object in database.
getValueFromExcel($excel, $row, $col)
getReferencesFromString($stringValues)
This method tries to get as many valid references out of a string separated by commata.
setMaxReferenceLength($max_reference_length)
loadValue()
Load the value.
getLinkHTML($link, $value)
Class ilDclBaseFieldModel.
getReferenceFromValue($value)