Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F70449207
PhabricatorMetaMTAApplicationEmailDatasource.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, Jul 6, 22:30
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Jul 8, 22:30 (2 d)
Engine
blob
Format
Raw Data
Handle
18845280
Attached To
rPH Phabricator
PhabricatorMetaMTAApplicationEmailDatasource.php
View Options
<?php
final
class
PhabricatorMetaMTAApplicationEmailDatasource
extends
PhabricatorTypeaheadDatasource
{
public
function
isBrowsable
()
{
// TODO: Make this browsable.
return
false
;
}
public
function
getBrowseTitle
()
{
return
pht
(
'Browse Email Addresses'
);
}
public
function
getPlaceholderText
()
{
return
pht
(
'Type an application email address...'
);
}
public
function
getDatasourceApplicationClass
()
{
return
'PhabricatorMetaMTAApplication'
;
}
public
function
loadResults
()
{
$viewer
=
$this
->
getViewer
();
$raw_query
=
$this
->
getRawQuery
();
$emails
=
id
(
new
PhabricatorMetaMTAApplicationEmailQuery
())
->
setViewer
(
$viewer
)
->
withAddressPrefix
(
$raw_query
)
->
setLimit
(
$this
->
getLimit
())
->
execute
();
if
(
$emails
)
{
$handles
=
id
(
new
PhabricatorHandleQuery
())
->
setViewer
(
$viewer
)
->
withPHIDs
(
mpull
(
$emails
,
'getPHID'
))
->
execute
();
}
else
{
$handles
=
array
();
}
$results
=
array
();
foreach
(
$handles
as
$handle
)
{
$results
[]
=
id
(
new
PhabricatorTypeaheadResult
())
->
setName
(
$handle
->
getName
())
->
setPHID
(
$handle
->
getPHID
());
}
return
$results
;
}
}
Event Timeline
Log In to Comment