Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F960290
FundInitiativeIndexer.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
FundInitiativeIndexer.php
View Options
<?php
final
class
FundInitiativeIndexer
extends
PhabricatorSearchDocumentIndexer
{
public
function
getIndexableObject
()
{
return
new
FundInitiative
();
}
protected
function
loadDocumentByPHID
(
$phid
)
{
$object
=
id
(
new
FundInitiativeQuery
())
->
setViewer
(
$this
->
getViewer
())
->
withPHIDs
(
array
(
$phid
))
->
executeOne
();
if
(!
$object
)
{
throw
new
Exception
(
pht
(
"Unable to load object by PHID '%s'!"
,
$phid
));
}
return
$object
;
}
protected
function
buildAbstractDocumentByPHID
(
$phid
)
{
$initiative
=
$this
->
loadDocumentByPHID
(
$phid
);
$doc
=
id
(
new
PhabricatorSearchAbstractDocument
())
->
setPHID
(
$initiative
->
getPHID
())
->
setDocumentType
(
FundInitiativePHIDType
::
TYPECONST
)
->
setDocumentTitle
(
$initiative
->
getName
())
->
setDocumentCreated
(
$initiative
->
getDateCreated
())
->
setDocumentModified
(
$initiative
->
getDateModified
());
$doc
->
addRelationship
(
PhabricatorSearchRelationship
::
RELATIONSHIP_AUTHOR
,
$initiative
->
getOwnerPHID
(),
PhabricatorPeopleUserPHIDType
::
TYPECONST
,
$initiative
->
getDateCreated
());
$doc
->
addRelationship
(
PhabricatorSearchRelationship
::
RELATIONSHIP_OWNER
,
$initiative
->
getOwnerPHID
(),
PhabricatorPeopleUserPHIDType
::
TYPECONST
,
$initiative
->
getDateCreated
());
$doc
->
addRelationship
(
$initiative
->
isClosed
()
?
PhabricatorSearchRelationship
::
RELATIONSHIP_CLOSED
:
PhabricatorSearchRelationship
::
RELATIONSHIP_OPEN
,
$initiative
->
getPHID
(),
FundInitiativePHIDType
::
TYPECONST
,
time
());
$this
->
indexTransactions
(
$doc
,
new
FundInitiativeTransactionQuery
(),
array
(
$initiative
->
getPHID
()));
return
$doc
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Jun 17, 10:45 PM (1 d, 9 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
224696
Default Alt Text
FundInitiativeIndexer.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment