Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F1094779
ManiphestAuxiliaryFieldSpecification.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
ManiphestAuxiliaryFieldSpecification.php
View Options
<?php
/**
* TODO: Destroy after ApplicationTransactions.
*/
final
class
ManiphestAuxiliaryFieldSpecification
{
public
static
function
writeLegacyAuxiliaryUpdates
(
ManiphestTask
$task
,
array
$map
)
{
$table
=
new
ManiphestCustomFieldStorage
();
$conn_w
=
$table
->
establishConnection
(
'w'
);
$update
=
array
();
$remove
=
array
();
foreach
(
$map
as
$key
=>
$value
)
{
$index
=
PhabricatorHash
::
digestForIndex
(
$key
);
if
(
$value
===
null
)
{
$remove
[
$index
]
=
true
;
}
else
{
$update
[
$index
]
=
$value
;
}
}
if
(
$remove
)
{
queryfx
(
$conn_w
,
'DELETE FROM %T WHERE objectPHID = %s AND fieldIndex IN (%Ls)'
,
$table
->
getTableName
(),
$task
->
getPHID
(),
array_keys
(
$remove
));
}
if
(
$update
)
{
$sql
=
array
();
foreach
(
$update
as
$index
=>
$val
)
{
$sql
[]
=
qsprintf
(
$conn_w
,
'(%s, %s, %s)'
,
$task
->
getPHID
(),
$index
,
$val
);
}
queryfx
(
$conn_w
,
'INSERT INTO %T (objectPHID, fieldIndex, fieldValue)
VALUES %Q ON DUPLICATE KEY
UPDATE fieldValue = VALUES(fieldValue)'
,
$table
->
getTableName
(),
implode
(
', '
,
$sql
));
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Jun 30, 9:16 AM (1 d, 23 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
270681
Default Alt Text
ManiphestAuxiliaryFieldSpecification.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment