Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93628126
ManiphestNameIndex.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
Sat, Nov 30, 06:40
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Dec 2, 06:40 (2 d)
Engine
blob
Format
Raw Data
Handle
22676273
Attached To
rPH Phabricator
ManiphestNameIndex.php
View Options
<?php
/**
* Denormalizes object names to support queries which need to be ordered or
* grouped by things like projects.
*/
final
class
ManiphestNameIndex
extends
ManiphestDAO
{
protected
$indexedObjectPHID
;
protected
$indexedObjectName
;
protected
function
getConfiguration
()
{
return
array
(
self
::
CONFIG_TIMESTAMPS
=>
false
,
self
::
CONFIG_COLUMN_SCHEMA
=>
array
(
'indexedObjectName'
=>
'sort128'
,
),
self
::
CONFIG_KEY_SCHEMA
=>
array
(
'key_phid'
=>
array
(
'columns'
=>
array
(
'indexedObjectPHID'
),
'unique'
=>
true
,
),
'key_name'
=>
array
(
'columns'
=>
array
(
'indexedObjectName'
),
),
),
)
+
parent
::
getConfiguration
();
}
public
static
function
updateIndex
(
$phid
,
$name
)
{
$table
=
new
ManiphestNameIndex
();
$conn_w
=
$table
->
establishConnection
(
'w'
);
queryfx
(
$conn_w
,
'INSERT INTO %T (indexedObjectPHID, indexedObjectName) VALUES (%s, %s)
ON DUPLICATE KEY UPDATE indexedObjectName = VALUES(indexedObjectName)'
,
$table
->
getTableName
(),
$phid
,
$name
);
}
}
Event Timeline
Log In to Comment