Differential D19103 Diff 45781 src/applications/phriction/engineextension/PhrictionContentSearchEngineAttachment.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phriction/engineextension/PhrictionContentSearchEngineAttachment.php
- This file was added.
<?php | |||||
final class PhrictionContentSearchEngineAttachment | |||||
extends PhabricatorSearchEngineAttachment { | |||||
public function getAttachmentName() { | |||||
return pht('Document Content'); | |||||
} | |||||
public function getAttachmentDescription() { | |||||
return pht('Get the content of documents or document histories.'); | |||||
} | |||||
public function getAttachmentForObject($object, $data, $spec) { | |||||
if ($object instanceof PhrictionDocument) { | |||||
$content = $object->getContent(); | |||||
} else { | |||||
$content = $object; | |||||
} | |||||
return array( | |||||
'title' => $content->getTitle(), | |||||
'path' => $content->getSlug(), | |||||
'authorPHID' => $content->getAuthorPHID(), | |||||
'content' => array( | |||||
'raw' => $content->getContent(), | |||||
), | |||||
); | |||||
} | |||||
} |