19 declare(strict_types=1);
33 $this->db = $DIC->database();
41 $query =
'DELETE FROM adv_md_record_obj_ord ' .
42 'WHERE obj_id = ' . $this->db->quote($obj_id,
'integer');
43 $this->db->manipulate($query);
116 $local_pos_a = $this->record_position_map[$a->
getRecordId()] ??
118 $local_pos_b = $this->record_position_map[$b->
getRecordId()] ??
120 if ($local_pos_a < $local_pos_b) {
123 if ($local_pos_a > $local_pos_b) {
134 $query =
'SELECT record_id, position FROM adv_md_record_obj_ord ' .
135 'WHERE obj_id = ' . $this->db->quote($obj_id,
'integer');
136 $res = $this->db->query($query);
138 $this->record_position_map = [];
140 $this->record_position_map[(
int) $row->record_id] = (
int) $row->position;
compareRecords(ilAdvancedMDRecord $a, ilAdvancedMDRecord $b)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
setGlobalPosition(int $position)
readPositionsForObject(int $obj_id)
Read local positions for object.
array $record_position_map
sortRecords(array $records, ?int $obj_id=null)
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
static _lookupContainerSetting(int $a_id, string $a_keyword, ?string $a_default_value=null)
deleteByObjId(int $obj_id)
Delete entries by obj_id.
compareLocalRecords(ilAdvancedMDRecord $a, ilAdvancedMDRecord $b)