19 declare(strict_types=1);
    31     public function get(
int $id, 
string $field): array
    34             throw new Exception(
"Invalid field: " . $field);
    36         $query = 
'SELECT id, ' . self::TABLE_NAME . 
'.over, scope, position_id FROM' . PHP_EOL
    38             . 
' WHERE ' . self::TABLE_NAME . 
'.' . $field . 
' = ' . $this->db->quote($id, 
'integer');
    39         $res = $this->db->query($query);
    41         while ($rec = $this->db->fetchAssoc(
$res)) {
    43                 ->withOver((
int) $rec[
'over'])
    44                 ->withScope((
int) $rec[
'scope'])
    45                 ->withPositionId((
int) $rec[
'position_id']);
    58         if ($authority->
getId() === 0) {
    59             $authority = $this->
insert($authority);
    69         $id = $this->db->nextId(self::TABLE_NAME);
    72             'id' => [ 
'integer', 
$id],
    73             'over' => [ 
'integer', $authority->
getOver() ],
    74             'scope' => [ 
'integer', $authority->
getScope() ],
    78         $this->db->insert(self::TABLE_NAME, $values);
    81             ->withOver($authority->
getOver())
    90         $where = [ 
'id' => [ 
'integer', $authority->
getId() ] ];
    93             'over' => [ 
'integer', $authority->
getOver() ],
    94             'scope' => [ 
'integer', $authority->
getScope() ],
    98         $this->db->update(self::TABLE_NAME, $values, $where);
   101     public function delete(
int $id): 
void   103         $query = 
'DELETE FROM ' . self::TABLE_NAME . PHP_EOL
   104             . 
' WHERE id = ' . $this->db->quote($id, 
'integer');
   106         $this->db->manipulate($query);
   114         $query = 
'DELETE FROM ' . self::TABLE_NAME . PHP_EOL
   115             . 
' WHERE position_id = ' . $this->db->quote($position_id, 
'integer');
   117         $this->db->manipulate($query);
   125         $query = 
'DELETE FROM ' . self::TABLE_NAME . PHP_EOL
   126             . 
' WHERE position_id = ' . $this->db->quote($position_id, 
'integer') . PHP_EOL
   127             . 
' AND ' . $this->db->in(
'id', $ids, 
true, 
'integer');
   129         $this->db->manipulate($query);
 store(ilOrgUnitAuthority $authority)
 
deleteLeftoverAuthorities(array $ids, int $position_id)
Deletes orphaned authorities on position save. 
 
update(ilOrgUnitAuthority $authority)
 
deleteByPositionId(int $position_id)
Deletes all authorities for a position. 
 
insert(ilOrgUnitAuthority $authority)
 
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins 
 
__construct(ilDBInterface $db)