Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phriction/storage/PhrictionDocument.php
<?php | <?php | ||||
final class PhrictionDocument extends PhrictionDAO | final class PhrictionDocument extends PhrictionDAO | ||||
implements | implements | ||||
PhabricatorPolicyInterface, | PhabricatorPolicyInterface, | ||||
PhabricatorSubscribableInterface, | PhabricatorSubscribableInterface, | ||||
PhabricatorFlaggableInterface, | PhabricatorFlaggableInterface, | ||||
PhabricatorTokenReceiverInterface, | PhabricatorTokenReceiverInterface, | ||||
PhabricatorDestructibleInterface, | PhabricatorDestructibleInterface, | ||||
PhabricatorApplicationTransactionInterface { | PhabricatorApplicationTransactionInterface, | ||||
PhabricatorSearchSnippetInterface { | |||||
protected $slug; | protected $slug; | ||||
protected $depth; | protected $depth; | ||||
protected $contentID; | protected $contentID; | ||||
protected $status; | protected $status; | ||||
protected $mailKey; | protected $mailKey; | ||||
protected $viewPolicy; | protected $viewPolicy; | ||||
protected $editPolicy; | protected $editPolicy; | ||||
▲ Show 20 Lines • Show All 228 Lines • ▼ Show 20 Lines | $this->openTransaction(); | ||||
$this->getID()); | $this->getID()); | ||||
foreach ($contents as $content) { | foreach ($contents as $content) { | ||||
$content->delete(); | $content->delete(); | ||||
} | } | ||||
$this->saveTransaction(); | $this->saveTransaction(); | ||||
} | } | ||||
/* -( PhabricatorSearchSnippetInterface )---------------------------------- */ | |||||
public function renderSearchResultSnippet(PhabricatorUser $viewer) { | |||||
$content = $this->getContent()->getContent(); | |||||
$content = PhabricatorMarkupEngine::summarize($content); | |||||
$content = PhabricatorMarkupEngine::renderOneObject( | |||||
id(new PhabricatorMarkupOneOff())->setContent($content), | |||||
'default', | |||||
$viewer); | |||||
return $content; | |||||
} | |||||
} | } |