42 $this->db = $DIC->database();
58 $type = $ilBiblEntry->getType();
62 $parsed_attributes = array();
63 foreach ($attributes as $attribute) {
64 $value = $this->secure($attribute->getValue());
67 $value = preg_replace(
'!(http)(s)?:\/\/[a-zA-Z0-9.?&_/\-~\!\'\*()+,:;@=$#\[\]%]+!',
"<a href=\"\\0\" target=\"_blank\">\\0</a>", $value);
71 $attribute->setValue($value);
72 $parsed_attributes[strtolower($this->file_type->getStringRepresentation() .
'_' . $type .
'_' . $attribute->getName())] = $value;
74 $this->field_factory->findOrCreateFieldOfAttribute($attribute);
77 return $parsed_attributes;
96 $inst = $this->
createEntry($bibliographic_obj_id, $entry_type);
98 $inst->setDataId($bibliographic_obj_id);
99 $inst->setEntryType($entry_type);
111 $inst->setDataId($bibliographic_obj_id);
112 $inst->setEntryType($entry_type);
136 foreach ($entries as $entry_id => $entry) {
140 return $entry_objects;
148 $types = [
"integer"];
149 $values = [$object_id];
151 $filters = $info->getFilters();
152 if (!empty($filters)) {
153 $q =
"SELECT (e.id), e.type FROM il_bibl_entry AS e WHERE data_id = %s";
154 foreach ($filters as $filter) {
155 $value = $filter->getFieldValue();
159 if ($filter->getOperator() ===
"IN" && is_array($filter->getFieldValue())) {
161 $values[] = $filter->getFieldName();
162 $q .=
" AND e.id IN (SELECT a.entry_id FROM il_bibl_attribute AS a WHERE a.name = %s AND " . $this->db->in(
"a.value", $value,
false,
"text") .
")";
165 $values[] = $filter->getFieldName();
167 $values[] =
"{$value}";
168 $q .=
" AND e.id IN (SELECT a.entry_id FROM il_bibl_attribute AS a WHERE a.name = %s AND a.value {$filter->getOperator()} %s )";
172 $q =
"SELECT DISTINCT (e.id), e.type FROM il_bibl_entry AS e 173 JOIN il_bibl_attribute AS a ON a.entry_id = e.id 177 $set = $this->db->queryF($q, $types, $values);
180 while ($rec = $this->db->fetchAssoc($set)) {
181 $entries[
$i][
'entry_id'] = $rec[
'id'];
182 $entries[
$i][
'entry_type'] = $rec[
'type'];
199 $this->db->manipulateF(
"DELETE FROM il_bibl_entry WHERE data_id = %s", [
'integer'], [$object_id]);
setAttributes(array $attributes)
createEntry(int $bibliographic_obj_id, string $entry_type)
setFileType(string $file_type)
findOrCreateEntry(int $id, int $bibliographic_obj_id, string $entry_type)
ilBiblOverviewModelFactoryInterface $overview_factory
int $bibliographic_obj_id
deleteEntriesById(int $object_id)
static where($where, $operator=null)
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...
__construct(ilBiblFieldFactoryInterface $field_factory, \ilBiblTypeInterface $file_type, ilBiblOverviewModelFactoryInterface $overview_factory)
ilBiblEntryFactory constructor.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
loadParsedAttributesByEntryId(int $entry_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
filterEntriesForTable(int $object_id, ilBiblTableQueryInfo $info=null)
filterEntryIdsForTableAsArray(int $object_id, ?ilBiblTableQueryInfo $info=null)
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...
ilBiblTypeInterface $file_type
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getAllAttributesByEntryId(int $id)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
findByIdAndTypeString(int $id, string $type_string)
ilBiblFieldFactoryInterface $field_factory
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...