19 declare(strict_types=1);
33 $this->dcl_obj_id = $dclTable->getObjId();
49 $exp_value = $ref_record_field->getExportValue();
50 $names[] = is_array($exp_value) ? array_shift($exp_value) : $exp_value;
54 return implode(
'; ', $names);
59 $exp_value = $ref_record_field->getExportValue();
61 return (
string) (is_array($exp_value) ? array_shift($exp_value) : $exp_value);
68 $value = parent::getValueFromExcel($excel, $row, $col);
72 $has_value = count(
$value);
78 if (!$has_value && $old) {
82 return [
'warning' => $warning];
96 $delimiter = strpos($stringValues,
'; ') ?
'; ' :
', ';
97 $slicedStrings = explode($delimiter, $stringValues);
98 $slicedReferences = [];
100 for ($i = 0; $i < count($slicedStrings); $i++) {
103 $searchString = implode(array_slice($slicedStrings, $resolved, $i - $resolved + 1));
105 $slicedReferences[] = $ref;
112 $searchString = $slicedStrings[$i];
114 $slicedReferences[] = $ref;
119 return $slicedReferences;
127 foreach ($table->getRecords() as
$record) {
130 if (is_array($record_value) && !is_array(
$value)) {
131 $record_value = array_shift($record_value);
133 if ($record_value ==
$value) {
146 if ($field_clone && $record_clone) {
148 $clone_references = $record_field_clone->getValue();
150 if (is_array($clone_references)) {
152 foreach ($clone_references as $clone_reference) {
157 } elseif (!is_null($temp_value = $this->
getCloneRecordId($clone_references))) {
169 if ($reference_record) {
170 return (
string) $reference_record->getId();
getValueFromExcel(ilExcel $excel, int $row, int $col)
setValue($value, bool $omit_parsing=false)
Set value for record field.
static getFieldCache(int $field_id=0)
getTableId()
Get table id.
getRecordField(int $field_id)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
doUpdate()
Update object in database.
static getTableCache(?int $table_id=null)
__construct(ilDclBaseRecordModel $record, ilDclBaseFieldModel $field)
getReferencesFromString(string $stringValues)
This method tries to get as many valid references out of a string separated by commata.
static getRecordCache(?int $record_id)
ilDclBaseFieldModel $field
getCloneRecordId(?string $clone_reference)
__construct(Container $dic, ilPlugin $plugin)
static getCloneOf(int $id, string $type)
static getExcelCharForInteger(int $int)
static getRecordFieldCache(object $record, object $field)
ilDclBaseRecordModel $record
getReferenceFromValue($value)