Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F519441
PhabricatorProjectSearchField.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
PhabricatorProjectSearchField.php
View Options
<?php
final
class
PhabricatorProjectSearchField
extends
PhabricatorSearchTokenizerField
{
protected
function
getDefaultValue
()
{
return
array
();
}
protected
function
newDatasource
()
{
return
new
PhabricatorProjectLogicalDatasource
();
}
protected
function
getValueFromRequest
(
AphrontRequest
$request
,
$key
)
{
$list
=
$this
->
getListFromRequest
(
$request
,
$key
);
$phids
=
array
();
$slugs
=
array
();
$project_type
=
PhabricatorProjectProjectPHIDType
::
TYPECONST
;
foreach
(
$list
as
$item
)
{
$type
=
phid_get_type
(
$item
);
if
(
$type
==
$project_type
)
{
$phids
[]
=
$item
;
}
else
{
if
(
PhabricatorTypeaheadDatasource
::
isFunctionToken
(
$item
))
{
// If this is a function, pass it through unchanged; we'll evaluate
// it later.
$phids
[]
=
$item
;
}
else
{
$slugs
[]
=
$item
;
}
}
}
if
(
$slugs
)
{
$projects
=
id
(
new
PhabricatorProjectQuery
())
->
setViewer
(
$this
->
requireViewer
())
->
withSlugs
(
$slugs
)
->
execute
();
foreach
(
$projects
as
$project
)
{
$phids
[]
=
$project
->
getPHID
();
}
$phids
=
array_unique
(
$phids
);
}
return
$phids
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, May 11, 5:47 PM (1 d, 23 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
110303
Default Alt Text
PhabricatorProjectSearchField.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment