Changeset View
Changeset View
Standalone View
Standalone View
src/applications/paste/storage/PhabricatorPaste.php
Show All 22 Lines | final class PhabricatorPaste extends PhabricatorPasteDAO | ||||
protected $status; | protected $status; | ||||
protected $spacePHID; | protected $spacePHID; | ||||
const STATUS_ACTIVE = 'active'; | const STATUS_ACTIVE = 'active'; | ||||
const STATUS_ARCHIVED = 'archived'; | const STATUS_ARCHIVED = 'archived'; | ||||
private $content = self::ATTACHABLE; | private $content = self::ATTACHABLE; | ||||
private $rawContent = self::ATTACHABLE; | private $rawContent = self::ATTACHABLE; | ||||
private $snippet = self::ATTACHABLE; | |||||
public static function initializeNewPaste(PhabricatorUser $actor) { | public static function initializeNewPaste(PhabricatorUser $actor) { | ||||
$app = id(new PhabricatorApplicationQuery()) | $app = id(new PhabricatorApplicationQuery()) | ||||
->setViewer($actor) | ->setViewer($actor) | ||||
->withClasses(array('PhabricatorPasteApplication')) | ->withClasses(array('PhabricatorPasteApplication')) | ||||
->executeOne(); | ->executeOne(); | ||||
$view_policy = $app->getPolicy(PasteDefaultViewCapability::CAPABILITY); | $view_policy = $app->getPolicy(PasteDefaultViewCapability::CAPABILITY); | ||||
▲ Show 20 Lines • Show All 91 Lines • ▼ Show 20 Lines | public function getRawContent() { | ||||
return $this->assertAttached($this->rawContent); | return $this->assertAttached($this->rawContent); | ||||
} | } | ||||
public function attachRawContent($raw_content) { | public function attachRawContent($raw_content) { | ||||
$this->rawContent = $raw_content; | $this->rawContent = $raw_content; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getSnippet() { | |||||
return $this->assertAttached($this->snippet); | |||||
} | |||||
public function attachSnippet(PhabricatorPasteSnippet $snippet) { | |||||
$this->snippet = $snippet; | |||||
return $this; | |||||
} | |||||
/* -( PhabricatorSubscribableInterface )----------------------------------- */ | /* -( PhabricatorSubscribableInterface )----------------------------------- */ | ||||
public function isAutomaticallySubscribed($phid) { | public function isAutomaticallySubscribed($phid) { | ||||
return ($this->authorPHID == $phid); | return ($this->authorPHID == $phid); | ||||
} | } | ||||
public function shouldShowSubscribersProperty() { | public function shouldShowSubscribersProperty() { | ||||
▲ Show 20 Lines • Show All 96 Lines • Show Last 20 Lines |