Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101074536
20160720.calendar.invitetxn.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Feb 5, 11:48
Size
890 B
Mime Type
text/x-php
Expires
Fri, Feb 7, 11:48 (1 d, 20 h)
Engine
blob
Format
Raw Data
Handle
24087230
Attached To
rPH Phabricator
20160720.calendar.invitetxn.php
View Options
<?php
$table
=
new
PhabricatorCalendarEventTransaction
();
$conn_w
=
$table
->
establishConnection
(
'w'
);
echo
pht
(
"Restructuring calendar invite transactions...
\n
"
);
foreach
(
new
LiskMigrationIterator
(
$table
)
as
$txn
)
{
$type
=
PhabricatorCalendarEventInviteTransaction
::
TRANSACTIONTYPE
;
if
(
$txn
->
getTransactionType
()
!=
$type
)
{
continue
;
}
$old_value
=
array_keys
(
$txn
->
getOldValue
());
$orig_new
=
$txn
->
getNewValue
();
$status_uninvited
=
'uninvited'
;
foreach
(
$orig_new
as
$key
=>
$status
)
{
if
(
$status
==
$status_uninvited
)
{
unset
(
$orig_new
[
$key
]);
}
}
$new_value
=
array_keys
(
$orig_new
);
queryfx
(
$conn_w
,
'UPDATE %T SET '
.
'oldValue = %s, newValue = %s'
.
'WHERE id = %d'
,
$table
->
getTableName
(),
phutil_json_encode
(
$old_value
),
phutil_json_encode
(
$new_value
),
$txn
->
getID
());
}
echo
pht
(
'Done.'
).
"
\n
"
;
Event Timeline
Log In to Comment