46 if ($this->type->isStandardField($inst->getIdentifier()) != $inst->getisStandardField()) {
47 $inst->setIsStandardField($this->type->isStandardField($inst->getIdentifier()));
63 throw new ilException(
"bibliografic identifier {$identifier} not found");
79 $inst->setIdentifier($identifier);
80 $inst->setDataType($type);
81 $inst->setIsStandardField((
bool) $this->
getType()->isStandardField($identifier));
84 $inst->setDataType($type);
85 $inst->setIdentifier($identifier);
86 $inst->setIsStandardField((
bool) $this->
getType()->isStandardField($identifier));
100 =
"SELECT DISTINCT(il_bibl_attribute.name), il_bibl_data.file_type FROM il_bibl_data 101 JOIN il_bibl_entry ON il_bibl_entry.data_id = il_bibl_data.id 102 JOIN il_bibl_attribute ON il_bibl_attribute.entry_id = il_bibl_entry.id 103 WHERE il_bibl_data.id = %s;";
105 $result = $DIC->database()->queryF($sql, [
'integer'], [$obj_id]);
108 while (
$d = $DIC->database()->fetchObject(
$result)) {
140 if ($field === null) {
142 $field->setIdentifier($attribute->
getName());
143 $field->setDataType($this->type->getId());
144 $field->setIsStandardField($this->type->isStandardField($attribute->
getName()));
147 $field->setDataType($this->type->getId());
162 $q =
"UPDATE {$tablename} SET position = position + 1 WHERE data_type = %s AND position >= %s;";
163 $DIC->database()->manipulateF(
165 [
'integer',
'integer'],
171 $DIC->database()->query(
"SET @i=0");
172 $DIC->database()->manipulateF(
173 "UPDATE {$tablename} SET position = (@i := @i + 1) WHERE data_type = %s ORDER BY position",
195 $q =
"SELECT MAX(position) + 1 as next_position FROM {$tablename} WHERE data_type = %s;";
196 $res = $DIC->database()->queryF($q, [
'integer'], [$field->
getDataType()]);
197 $data = $DIC->database()->fetchObject(
$res);
199 return (
int)
$data->next_position;
227 throw new ilException(
"bibliografic type not found");
242 $collection->where(array(
'data_type' => $type->
getId()));
245 $sorting_column = $queryInfo->getSortingColumn() ? $queryInfo->getSortingColumn() : null;
246 $offset = $queryInfo->getOffset() ? $queryInfo->getOffset() : 0;
247 $sorting_direction = $queryInfo->getSortingDirection();
248 $limit = $queryInfo->getLimit();
249 if ($sorting_column) {
250 $collection->orderBy($sorting_column, $sorting_direction);
252 $collection->limit($offset, $limit);
254 foreach ($queryInfo->getFilters() as $queryFilter) {
255 switch ($queryFilter->getFieldName()) {
257 $collection->where(array($queryFilter->getFieldName() => $queryFilter->getFieldValue()), $queryFilter->getOperator());
__construct(\ilBiblTypeInterface $type)
ilBiblFieldFactory constructor.
store()
Stores the Object, creates a newone in Db if non existing or updates an existing. ...
Interface ilBiblEntryInterface.
Interface ilBiblAttributeInterface.
forcePosition(ilBiblFieldInterface $field)
if(!array_key_exists('StateId', $_REQUEST)) $id
static where($where, $operator=null)
getFieldByTypeAndIdentifier(int $type, string $identifier)
MUST be ilBiblTypeFactoryInterface::DATA_TYPE_RIS or ilBiblTypeFactoryInterface::DATA_TYPE_BIBTEX ...
foreach($_POST as $key=> $value) $res
Interface ilBiblTypeInterface.
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)
Interface ilBiblFieldFactoryInterface.
getNextFreePosition(ilBiblFieldInterface $field)
findOrCreateFieldOfAttribute(ilBiblAttributeInterface $attribute)
getARInstance($type, $identifier)
filterAllFieldsForTypeAsArray(ilBiblTypeInterface $type, ilBiblTableQueryInfoInterface $queryInfo=null)
findOrCreateFieldByTypeAndIdentifier(int $type, string $identifier)
MUST be ilBiblTypeFactoryInterface::DATA_TYPE_RIS or ilBiblTypeFactoryInterface::DATA_TYPE_BIBTEX ...
Class ilBiblFieldFactory.
Interface ilBiblTableQueryInfoInterface.
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d
getCollectionForFilter(ilBiblTypeInterface $type, ilBiblTableQueryInfoInterface $queryInfo=null)