29 $this->db = $DIC->database();
37 $q =
"SELECT DISTINCT(a.value) FROM il_bibl_data AS d 38 JOIN il_bibl_entry AS e ON e.data_id = d.id 39 JOIN il_bibl_attribute AS a on a.entry_id = e.id 40 WHERE a.name = %s AND d.id = %s";
42 $res = $this->db->queryF(
$q, [
'text',
'integer'], [
47 while (
$data = $this->db->fetchObject(
$res)) {
68 $type_id = $this->field_factory->getType()->getId();
70 foreach ($attributes as $attribute) {
71 if (!$attribute->getName()) {
74 $field = $this->field_factory->findOrCreateFieldByTypeAndIdentifier($type_id, $attribute->getName());
75 $position = $field->getPosition();
76 $position = $position ?: $max + 1;
78 $max = (max($position, $max));
79 $sorted[$position] = $attribute;
93 $ilBiblAttribute->setName($name);
94 $ilBiblAttribute->setValue($value);
95 $ilBiblAttribute->setEntryId($entry_id);
96 $ilBiblAttribute->store();
98 $this->field_factory->findOrCreateFieldOfAttribute($ilBiblAttribute);
sortAttributes(array $attributes)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getPossibleValuesForFieldAndObject(ilBiblFieldInterface $field, int $object_id)
static where($where, $operator=null)
createAttribute(string $name, string $value, int $entry_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(protected \ilBiblFieldFactoryInterface $field_factory)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getAttributesForEntry(ilBiblEntryInterface $entry)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...