Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F480010
PhabricatorSearchSpacesField.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
981 B
Referenced Files
None
Subscribers
None
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
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Wed, May 7, 9:55 AM (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
87431
Default Alt Text
PhabricatorSearchSpacesField.php (981 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment