Elgg  Version 6.1
20220825064811_merge_private_settings_in_metadata.php
Go to the documentation of this file.
1 <?php
2 declare(strict_types=1);
3 
5 
6 final class MergePrivateSettingsInMetadata extends AbstractMigration {
10  public function change(): void {
11 
12  if (!$this->hasTable('private_settings')) {
13  return;
14  }
15 
16  $prefix = $this->getAdapter()->getOption('table_prefix');
17  $time_created = time();
18 
19  $this->execute("
20  INSERT INTO {$prefix}metadata (entity_guid, name, value, value_type, time_created)
21  SELECT
22  ps.entity_guid AS entity_guid,
23  ps.name AS name,
24  ps.value AS value,
25  'text' AS value_type,
26  {$time_created} AS time_created
27  FROM {$prefix}private_settings ps
28  ");
29 
30  // all data migrated, so drop the table
31  $this->table('private_settings')->drop()->save();
32  }
33 }
if(!$user instanceof\ElggUser) $time_created
Definition: online.php:13
c Accompany it with the information you received as to the offer to distribute corresponding source complete source code means all the source code for all modules it plus any associated interface definition plus the scripts used to control compilation and installation of the executable as a special the source code distributed need not include anything that is normally and so on of the operating system on which the executable unless that component itself accompanies the executable If distribution of executable or object code is made by offering access to copy from a designated then offering equivalent access to copy the source code from the same place counts as distribution of the source even though third parties are not compelled to copy the source along with the object code You may not or distribute the Program except as expressly provided under this License Any attempt otherwise to sublicense or distribute the Program is void
Definition: LICENSE.txt:215
change()
Moves private settings to metadata and drops the private settings table.