Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93604322
PhabricatorSearchSpacesField.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, 02:35
Size
981 B
Mime Type
text/x-php
Expires
Mon, Dec 2, 02:35 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22671889
Attached To
rPH Phabricator
PhabricatorSearchSpacesField.php
View Options
<?php
final
class
PhabricatorSearchSpacesField
extends
PhabricatorSearchTokenizerField
{
protected
function
getDefaultValue
()
{
return
array
();
}
protected
function
newDatasource
()
{
return
new
PhabricatorSpacesNamespaceDatasource
();
}
protected
function
getValueFromRequest
(
AphrontRequest
$request
,
$key
)
{
$viewer
=
$this
->
getViewer
();
$list
=
$this
->
getListFromRequest
(
$request
,
$key
);
$type
=
new
PhabricatorSpacesNamespacePHIDType
();
$phids
=
array
();
$names
=
array
();
foreach
(
$list
as
$item
)
{
if
(
$type
->
canLoadNamedObject
(
$item
))
{
$names
[]
=
$item
;
}
else
{
$phids
[]
=
$item
;
}
}
if
(
$names
)
{
$spaces
=
id
(
new
PhabricatorObjectQuery
())
->
setViewer
(
$viewer
)
->
withNames
(
$names
)
->
execute
();
foreach
(
mpull
(
$spaces
,
'getPHID'
)
as
$phid
)
{
$phids
[]
=
$phid
;
}
$phids
=
array_unique
(
$phids
);
}
return
$phids
;
}
}
Event Timeline
Log In to Comment