26 protected \ilBiblTypeInterface
$type;
56 if ($this->type->isStandardField($inst->getIdentifier()) !== $inst->isStandardField()) {
57 $inst->setIsStandardField($this->type->isStandardField($inst->getIdentifier()));
72 throw new ilException(
"bibliografic identifier {$identifier} not found");
88 $inst->setIdentifier($identifier);
89 $inst->setDataType($type);
90 $inst->setIsStandardField($this->
getType()->isStandardField($identifier));
93 $inst->setDataType($type);
94 $inst->setIdentifier($identifier);
95 $inst->setIsStandardField($this->
getType()->isStandardField($identifier));
109 =
"SELECT DISTINCT(il_bibl_attribute.name), il_bibl_data.file_type FROM il_bibl_data 110 JOIN il_bibl_entry ON il_bibl_entry.data_id = il_bibl_data.id 111 JOIN il_bibl_attribute ON il_bibl_attribute.entry_id = il_bibl_entry.id 112 WHERE il_bibl_data.id = %s;";
114 $result = $DIC->database()->queryF($sql, [
'integer'], [$obj_id]);
117 while (
$d = $DIC->database()->fetchObject($result)) {
149 if ($field === null) {
151 $field->setIdentifier($attribute->
getName());
152 $field->setDataType($this->type->getId());
153 $field->setIsStandardField($this->type->isStandardField($attribute->
getName()));
156 $field->setDataType($this->type->getId());
171 $q =
"UPDATE {$tablename} SET position = position + 1 WHERE data_type = %s AND position >= %s;";
172 $DIC->database()->manipulateF(
174 [
'integer',
'integer'],
181 $DIC->database()->query(
"SET @i=0");
182 $DIC->database()->manipulateF(
183 "UPDATE {$tablename} SET position = (@i := @i + 1) WHERE data_type = %s ORDER BY position",
205 $q =
"SELECT MAX(position) + 1 as next_position FROM {$tablename} WHERE data_type = %s;";
206 $res = $DIC->database()->queryF($q, [
'integer'], [$field->
getDataType()]);
207 $data = $DIC->database()->fetchObject(
$res);
209 return (
int)
$data->next_position;
215 return ilBiblField::where([
"identifier" => $identifier,
"data_type" => $type])->first();
223 $collection->where(array(
'data_type' => $type->
getId()));
226 $sorting_column = $queryInfo->getSortingColumn() ? $queryInfo->getSortingColumn() : null;
227 $offset = $queryInfo->getOffset() ? $queryInfo->getOffset() : 0;
228 $sorting_direction = $queryInfo->getSortingDirection();
229 $limit = $queryInfo->getLimit();
230 if ($sorting_column) {
231 $collection->orderBy($sorting_column, $sorting_direction);
233 $collection->limit($offset, $limit);
235 foreach ($queryInfo->getFilters() as $queryFilter) {
236 switch ($queryFilter->getFieldName()) {
238 $collection->where(array($queryFilter->getFieldName() => $queryFilter->getFieldValue()), $queryFilter->getOperator());
__construct(\ilBiblTypeInterface $type)
ilBiblFieldFactory constructor.
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...
NullPointerExceptionInspection
forcePosition(ilBiblFieldInterface $field)
ilBiblTypeInterface $type
static where($where, $operator=null)
getFieldByTypeAndIdentifier(int $type, string $identifier)
MUST be ilBiblTypeFactoryInterface::DATA_TYPE_RIS or ilBiblTypeFactoryInterface::DATA_TYPE_BIBTEX ...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static findOrFail($primary_key, array $add_constructor_args=array())
Tries to find the object and throws an Exception if object is not found, instead of returning null...
filterAllFieldsForType(ilBiblTypeInterface $type, ilBiblTableQueryInfoInterface $queryInfo=null)
getAvailableFieldsForObjId(int $obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getNextFreePosition(ilBiblFieldInterface $field)
findOrCreateFieldOfAttribute(ilBiblAttributeInterface $attribute)
filterAllFieldsForTypeAsArray(ilBiblTypeInterface $type, ilBiblTableQueryInfoInterface $queryInfo=null)
findOrCreateFieldByTypeAndIdentifier(int $type, string $identifier)
MUST be ilBiblTypeFactoryInterface::DATA_TYPE_RIS or ilBiblTypeFactoryInterface::DATA_TYPE_BIBTEX ...
getARInstance(int $type, string $identifier)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d
getCollectionForFilter(ilBiblTypeInterface $type, ilBiblTableQueryInfoInterface $queryInfo=null)