Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F94191064
PhabricatorUserSearchIndexer.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
Wed, Dec 4, 14:51
Size
979 B
Mime Type
text/x-php
Expires
Fri, Dec 6, 14:51 (2 d)
Engine
blob
Format
Raw Data
Handle
22754332
Attached To
rPH Phabricator
PhabricatorUserSearchIndexer.php
View Options
<?php
final
class
PhabricatorUserSearchIndexer
extends
PhabricatorSearchDocumentIndexer
{
public
function
getIndexableObject
()
{
return
new
PhabricatorUser
();
}
protected
function
buildAbstractDocumentByPHID
(
$phid
)
{
$user
=
$this
->
loadDocumentByPHID
(
$phid
);
$doc
=
new
PhabricatorSearchAbstractDocument
();
$doc
->
setPHID
(
$user
->
getPHID
());
$doc
->
setDocumentType
(
PhabricatorPeoplePHIDTypeUser
::
TYPECONST
);
$doc
->
setDocumentTitle
(
$user
->
getUserName
().
' ('
.
$user
->
getRealName
().
')'
);
$doc
->
setDocumentCreated
(
$user
->
getDateCreated
());
$doc
->
setDocumentModified
(
$user
->
getDateModified
());
// TODO: Index the blurbs from their profile or something? Probably not
// actually useful...
if
(
$user
->
isUserActivated
())
{
$doc
->
addRelationship
(
PhabricatorSearchRelationship
::
RELATIONSHIP_OPEN
,
$user
->
getPHID
(),
PhabricatorPeoplePHIDTypeUser
::
TYPECONST
,
time
());
}
return
$doc
;
}
}
Event Timeline
Log In to Comment