ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
ilFileServicesDatabaseObjective Class Reference
+ Inheritance diagram for ilFileServicesDatabaseObjective:
+ Collaboration diagram for ilFileServicesDatabaseObjective:

Public Member Functions

 prepare (ilDBInterface $db)
 
 step_1 ()
 adds a new table to store data of file upload policies More...
 
- Public Member Functions inherited from ilDatabaseUpdateSteps
 prepare (\ilDBInterface $db)
 Prepare the execution of the steps. More...
 

Protected Member Functions

 abortIfNotPrepared ()
 

Protected Attributes

ilDBInterface $database = null
 

Detailed Description

Member Function Documentation

◆ abortIfNotPrepared()

ilFileServicesDatabaseObjective::abortIfNotPrepared ( )
protected
Exceptions
LogicExceptionif the database update steps were not yet prepared.

Definition at line 109 of file class.ilFileServicesDatabaseObjective.php.

Referenced by step_1().

109  : void
110  {
111  if (null === $this->database) {
112  throw new LogicException(self::class . "::prepare() must be called before db-update-steps execution.");
113  }
114  }
+ Here is the caller graph for this function:

◆ prepare()

ilFileServicesDatabaseObjective::prepare ( ilDBInterface  $db)

Definition at line 27 of file class.ilFileServicesDatabaseObjective.php.

27  : void
28  {
29  $this->database = $db;
30  }

◆ step_1()

ilFileServicesDatabaseObjective::step_1 ( )

adds a new table to store data of file upload policies

Definition at line 35 of file class.ilFileServicesDatabaseObjective.php.

References abortIfNotPrepared().

35  : void
36  {
37  $this->abortIfNotPrepared();
38 
39  if ($this->database->tableExists("il_upload_policy")) {
40  return;
41  }
42 
43  $this->database->createTable("il_upload_policy", [
44  "policy_id" => [
45  'type' => 'integer',
46  'length' => 8,
47  'notnull' => true,
48  ],
49  "title" => [
50  'type' => 'text',
51  'length' => 256,
52  'notnull' => true,
53  ],
54  "upload_limit_in_mb" => [
55  'type' => 'integer',
56  'length' => 8,
57  'notnull' => true,
58  ],
59  "audience" => [
60  'type' => 'text',
61  'length' => 512,
62  'notnull' => true,
63  ],
64  "audience_type" => [
65  'type' => 'integer',
66  'length' => 2,
67  'notnull' => true,
68  ],
69  "scope_definition" => [
70  'type' => 'text',
71  'length' => 512,
72  'notnull' => true,
73  ],
74  "active" => [
75  'type' => 'integer',
76  'length' => 1,
77  'notnull' => true,
78  ],
79  "valid_from" => [
80  'type' => 'date',
81  'notnull' => false,
82  ],
83  "valid_until" => [
84  'type' => 'date',
85  'notnull' => false,
86  ],
87  "owner" => [
88  'type' => 'integer',
89  'length' => 8,
90  'notnull' => true,
91  ],
92  "create_date" => [
93  'type' => 'timestamp',
94  'notnull' => true,
95  ],
96  "last_update" => [
97  'type' => 'timestamp',
98  'notnull' => true,
99  ]
100  ]);
101 
102  $this->database->createSequence("il_upload_policy");
103  }
+ Here is the call graph for this function:

Field Documentation

◆ $database

ilDBInterface ilFileServicesDatabaseObjective::$database = null
protected

Definition at line 25 of file class.ilFileServicesDatabaseObjective.php.


The documentation for this class was generated from the following file: