mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-25 00:02:41 +01:00
8f0bab73ef
Summary: Hook D4261 into ApplicationTransaction Test Plan: Edited a mock; searched for it. Reviewers: btrahan, vrana Reviewed By: btrahan CC: aran Maniphest Tasks: T2104 Differential Revision: https://secure.phabricator.com/D4262
34 lines
910 B
PHP
34 lines
910 B
PHP
<?php
|
|
|
|
/**
|
|
* @group pholio
|
|
*/
|
|
final class PholioSearchIndexer extends PhabricatorSearchDocumentIndexer {
|
|
|
|
public function getIndexableObject() {
|
|
return new PholioMock();
|
|
}
|
|
|
|
protected function buildAbstractDocumentByPHID($phid) {
|
|
$mock = $this->loadDocumentByPHID($phid);
|
|
|
|
$doc = new PhabricatorSearchAbstractDocument();
|
|
$doc->setPHID($mock->getPHID());
|
|
$doc->setDocumentType(phid_get_type($mock->getPHID()));
|
|
$doc->setDocumentTitle($mock->getName());
|
|
$doc->setDocumentCreated($mock->getDateCreated());
|
|
$doc->setDocumentModified($mock->getDateModified());
|
|
|
|
$doc->addField(
|
|
PhabricatorSearchField::FIELD_BODY,
|
|
$mock->getDescription());
|
|
|
|
$doc->addRelationship(
|
|
PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR,
|
|
$mock->getAuthorPHID(),
|
|
PhabricatorPHIDConstants::PHID_TYPE_USER,
|
|
$mock->getDateCreated());
|
|
|
|
return $doc;
|
|
}
|
|
}
|