Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/maniphest/search/ManiphestTaskFulltextEngine.php
12256 views
1
<?php
2
3
final class ManiphestTaskFulltextEngine
4
extends PhabricatorFulltextEngine {
5
6
protected function buildAbstractDocument(
7
PhabricatorSearchAbstractDocument $document,
8
$object) {
9
10
$task = $object;
11
12
$document->setDocumentTitle($task->getTitle());
13
14
$document->addField(
15
PhabricatorSearchDocumentFieldType::FIELD_BODY,
16
$task->getDescription());
17
18
$document->addRelationship(
19
PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR,
20
$task->getAuthorPHID(),
21
PhabricatorPeopleUserPHIDType::TYPECONST,
22
$task->getDateCreated());
23
24
$document->addRelationship(
25
$task->isClosed()
26
? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED
27
: PhabricatorSearchRelationship::RELATIONSHIP_OPEN,
28
$task->getPHID(),
29
ManiphestTaskPHIDType::TYPECONST,
30
PhabricatorTime::getNow());
31
32
$owner = $task->getOwnerPHID();
33
if ($owner) {
34
$document->addRelationship(
35
PhabricatorSearchRelationship::RELATIONSHIP_OWNER,
36
$owner,
37
PhabricatorPeopleUserPHIDType::TYPECONST,
38
time());
39
} else {
40
$document->addRelationship(
41
PhabricatorSearchRelationship::RELATIONSHIP_UNOWNED,
42
$task->getPHID(),
43
PhabricatorPHIDConstants::PHID_TYPE_VOID,
44
$task->getDateCreated());
45
}
46
}
47
48
}
49
50