Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99906178
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
Mon, Jan 27, 05:34
Size
890 B
Mime Type
text/x-php
Expires
Wed, Jan 29, 05:34 (2 d)
Engine
blob
Format
Raw Data
Handle
23846447
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