3 final class PhabricatorFileExternalRequest
extends PhabricatorFileDAO
5 PhabricatorDestructibleInterface
{
11 protected $isSuccessful;
12 protected $responseMessage;
14 protected function getConfiguration() {
16 self
::CONFIG_COLUMN_SCHEMA
=> array(
18 'uriIndex' => 'bytes12',
20 'filePHID' => 'phid?',
21 'isSuccessful' => 'bool',
22 'responseMessage' => 'text?',
24 self
::CONFIG_KEY_SCHEMA
=> array(
25 'key_uriindex' => array(
26 'columns' => array('uriIndex'),
30 'columns' => array('ttl'),
33 'columns' => array('filePHID'),
36 ) + parent
::getConfiguration();
39 public function save() {
40 $hash = PhabricatorHash
::digestForIndex($this->getURI());
41 $this->setURIIndex($hash);
42 return parent
::save();
45 /* -( PhabricatorDestructibleInterface )----------------------------------- */
47 public function destroyObjectPermanently(
48 PhabricatorDestructionEngine
$engine) {
50 $file_phid = $this->getFilePHID();
52 $file = id(new PhabricatorFileQuery())
53 ->setViewer($engine->getViewer())
54 ->withPHIDs(array($file_phid))
57 $engine->destroyObject($file);