Page MenuHomePhorge

20170811.differential.03.modernxaction.php
No OneTemporary

Size
850 B
Referenced Files
None
Subscribers
None

20170811.differential.03.modernxaction.php

<?php
$map = array(
'0' => 'needs-review',
'1' => 'needs-revision',
'2' => 'accepted',
'3' => 'published',
'4' => 'abandoned',
'5' => 'changes-planned',
);
$table = new DifferentialTransaction();
$conn = $table->establishConnection('w');
foreach (new LiskMigrationIterator($table) as $xaction) {
$type = $xaction->getTransactionType();
if (($type != 'differential:status') &&
($type != 'differential.revision.status')) {
continue;
}
$old = $xaction->getOldValue();
$new = $xaction->getNewValue();
$old = idx($map, $old, $old);
$new = idx($map, $new, $new);
queryfx(
$conn,
'UPDATE %T SET transactionType = %s, oldValue = %s, newValue = %s
WHERE id = %d',
$table->getTableName(),
'differential.revision.status',
json_encode($old),
json_encode($new),
$xaction->getID());
}

File Metadata

Mime Type
text/x-php
Expires
Wed, Jun 18, 6:33 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
227580
Default Alt Text
20170811.differential.03.modernxaction.php (850 B)

Event Timeline