Changeset View
Changeset View
Standalone View
Standalone View
src/applications/project/search/PhabricatorProjectSearchIndexer.php
| Show All 11 Lines | protected function buildAbstractDocumentByPHID($phid) { | ||||
| $doc = new PhabricatorSearchAbstractDocument(); | $doc = new PhabricatorSearchAbstractDocument(); | ||||
| $doc->setPHID($project->getPHID()); | $doc->setPHID($project->getPHID()); | ||||
| $doc->setDocumentType(PhabricatorProjectPHIDTypeProject::TYPECONST); | $doc->setDocumentType(PhabricatorProjectPHIDTypeProject::TYPECONST); | ||||
| $doc->setDocumentTitle($project->getName()); | $doc->setDocumentTitle($project->getName()); | ||||
| $doc->setDocumentCreated($project->getDateCreated()); | $doc->setDocumentCreated($project->getDateCreated()); | ||||
| $doc->setDocumentModified($project->getDateModified()); | $doc->setDocumentModified($project->getDateModified()); | ||||
| $this->indexSubscribers($doc); | |||||
| $this->indexCustomFields($doc, $project); | |||||
| $doc->addRelationship( | $doc->addRelationship( | ||||
| $project->isArchived() | $project->isArchived() | ||||
| ? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED | ? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED | ||||
| : PhabricatorSearchRelationship::RELATIONSHIP_OPEN, | : PhabricatorSearchRelationship::RELATIONSHIP_OPEN, | ||||
| $project->getPHID(), | $project->getPHID(), | ||||
| PhabricatorProjectPHIDTypeProject::TYPECONST, | PhabricatorProjectPHIDTypeProject::TYPECONST, | ||||
| time()); | time()); | ||||
| // NOTE: This could be more full-featured, but for now we're mostly | // NOTE: This could be more full-featured, but for now we're mostly | ||||
| // interested in the side effects of indexing. | // interested in the side effects of indexing. | ||||
| return $doc; | return $doc; | ||||
| } | } | ||||
| } | } | ||||