Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2991870
PhabricatorTransactionsObjectTypeDatasource.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
1 KB
Referenced Files
None
Subscribers
None
PhabricatorTransactionsObjectTypeDatasource.php
View Options
<?php
final
class
PhabricatorTransactionsObjectTypeDatasource
extends
PhabricatorTypeaheadDatasource
{
public
function
getBrowseTitle
(
)
{
return
pht
(
'Browse Forms'
)
;
}
public
function
getPlaceholderText
(
)
{
return
pht
(
'Type an object type name...'
)
;
}
public
function
getDatasourceApplicationClass
(
)
{
return
PhabricatorTransactionsApplication
::
class
;
}
protected
function
renderSpecialTokens
(
array
$values
)
{
return
$this
->
renderTokensFromResults
(
$this
->
buildResults
(
)
,
$values
)
;
}
public
function
loadResults
(
)
{
$results
=
$this
->
buildResults
(
)
;
return
$this
->
filterResultsAgainstTokens
(
$results
)
;
}
private
function
buildResults
(
)
{
$queries
=
id
(
new
PhutilClassMapQuery
(
)
)
->
setAncestorClass
(
'PhabricatorApplicationTransactionQuery'
)
->
execute
(
)
;
$phid_types
=
PhabricatorPHIDType
::
getAllTypes
(
)
;
$results
=
array
(
)
;
foreach
(
$queries
as
$query
)
{
$query_type
=
$query
->
getTemplateApplicationTransaction
(
)
->
getApplicationTransactionType
(
)
;
$phid_type
=
idx
(
$phid_types
,
$query_type
)
;
if
(
$phid_type
)
{
$name
=
$phid_type
->
getTypeName
(
)
;
$icon
=
$phid_type
->
getTypeIcon
(
)
;
}
else
{
$name
=
pht
(
'%s ("%s")'
,
$query_type
,
get_class
(
$query
)
)
;
$icon
=
null
;
}
$result
=
id
(
new
PhabricatorTypeaheadResult
(
)
)
->
setName
(
$name
)
->
setPHID
(
$query_type
)
;
if
(
$icon
)
{
$result
->
setIcon
(
$icon
)
;
}
$results
[
$query_type
]
=
$result
;
}
return
$results
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Feb 23, 04:28 (1 d, 10 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1171938
Default Alt Text
PhabricatorTransactionsObjectTypeDatasource.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment