Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2891271
20160720.calendar.invitetxn.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
890 B
Referenced Files
None
Subscribers
None
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"
;
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Jan 19, 14:56 (3 w, 1 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1125721
Default Alt Text
20160720.calendar.invitetxn.php (890 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment