Elgg
Version 6.0
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
engine
schema
migrations
20211224075815_set_comments_level_one.php
Go to the documentation of this file.
1
<?php
2
declare(strict_types=1);
3
4
use
Phinx\Migration\AbstractMigration
;
5
6
final
class
SetCommentsLevelOne
extends
AbstractMigration {
10
public
function
up
() {
11
$prefix = $this->getAdapter()->getOption(
'table_prefix'
);
12
13
$sub_query =
"SELECT entity_guid FROM {$prefix}metadata WHERE name = 'level'"
;
14
$time_created
= time();
15
16
$this->execute(
"
17
INSERT INTO {$prefix}metadata (entity_guid, name, value, value_type, time_created)
18
SELECT
19
e.guid AS entity_guid,
20
'level' AS name,
21
1 AS value,
22
'integer' AS value_type,
23
{$time_created} AS time_created
24
FROM {$prefix}entities e
25
WHERE
26
e.guid NOT IN ({$sub_query}) AND
27
e.type = 'object' AND
28
e.subtype = 'comment'
29
"
);
30
}
31
}
SetCommentsLevelOne
Definition:
20211224075815_set_comments_level_one.php:6
$time_created
if(!$user instanceof\ElggUser) $time_created
Definition:
online.php:13
SetCommentsLevelOne\up
up()
Add level = 1 metadata to comments.
Definition:
20211224075815_set_comments_level_one.php:10
AbstractMigration
Generated on Sun Oct 13 2024 00:00:24 for Elgg by
1.8.11