ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
DBRepository.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
24
26{
27 public const TST_EXPORT_TABLE = 'tst_exports';
28
29 public function __construct(
30 private readonly \ilDBInterface $db
31 ) {
32 }
33
34 public function store(
35 int $object_id,
36 Types $type,
38 ): void {
39 $this->db->insert(
40 self::TST_EXPORT_TABLE,
41 [
42 'object_id' => [
43 \ilDBConstants::T_INTEGER,
44 $object_id
45 ],
46 'type' => [
47 \ilDBConstants::T_TEXT,
48 $type->value
49 ],
50 'rid' => [
51 \ilDBConstants::T_TEXT,
52 $rid->serialize()
53 ],
54 ]
55 );
56 }
57
58 public function delete(
60 ): void {
61 $this->db->manipulateF(
62 'DELETE FROM ' . self::TST_EXPORT_TABLE . ' WHERE rid = %s',
64 [$rid->serialize()]
65 );
66 }
67
68 public function getFor(
69 int $object_id
70 ): array {
71 return $this->db->fetchAll(
72 $this->db->queryF(
73 'SELECT * FROM ' . self::TST_EXPORT_TABLE . ' WHERE object_id = %s',
74 [\ilDBConstants::T_INTEGER],
75 [$object_id]
76 )
77 );
78 }
79}
__construct(private readonly \ilDBInterface $db)
store(int $object_id, Types $type, ResourceIdentification $rid)
Class ilDBConstants.
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface ilDBInterface.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...