Changeset View
Changeset View
Standalone View
Standalone View
src/applications/files/storage/PhabricatorFile.php
| Show All 18 Lines | |||||
| */ | */ | ||||
| final class PhabricatorFile extends PhabricatorFileDAO | final class PhabricatorFile extends PhabricatorFileDAO | ||||
| implements | implements | ||||
| PhabricatorApplicationTransactionInterface, | PhabricatorApplicationTransactionInterface, | ||||
| PhabricatorTokenReceiverInterface, | PhabricatorTokenReceiverInterface, | ||||
| PhabricatorSubscribableInterface, | PhabricatorSubscribableInterface, | ||||
| PhabricatorFlaggableInterface, | PhabricatorFlaggableInterface, | ||||
| PhabricatorPolicyInterface, | PhabricatorPolicyInterface, | ||||
| PhabricatorDestructibleInterface { | PhabricatorDestructibleInterface, | ||||
| PhabricatorConduitResultInterface { | |||||
| const METADATA_IMAGE_WIDTH = 'width'; | const METADATA_IMAGE_WIDTH = 'width'; | ||||
| const METADATA_IMAGE_HEIGHT = 'height'; | const METADATA_IMAGE_HEIGHT = 'height'; | ||||
| const METADATA_CAN_CDN = 'canCDN'; | const METADATA_CAN_CDN = 'canCDN'; | ||||
| const METADATA_BUILTIN = 'builtin'; | const METADATA_BUILTIN = 'builtin'; | ||||
| const METADATA_PARTIAL = 'partial'; | const METADATA_PARTIAL = 'partial'; | ||||
| const METADATA_PROFILE = 'profile'; | const METADATA_PROFILE = 'profile'; | ||||
| const METADATA_STORAGE = 'storage'; | const METADATA_STORAGE = 'storage'; | ||||
| ▲ Show 20 Lines • Show All 1,427 Lines • ▼ Show 20 Lines | /* -( PhabricatorDestructibleInterface )----------------------------------- */ | ||||
| public function destroyObjectPermanently( | public function destroyObjectPermanently( | ||||
| PhabricatorDestructionEngine $engine) { | PhabricatorDestructionEngine $engine) { | ||||
| $this->openTransaction(); | $this->openTransaction(); | ||||
| $this->delete(); | $this->delete(); | ||||
| $this->saveTransaction(); | $this->saveTransaction(); | ||||
| } | } | ||||
| /* -( PhabricatorConduitResultInterface )---------------------------------- */ | |||||
| public function getFieldSpecificationsForConduit() { | |||||
| return array( | |||||
| id(new PhabricatorConduitSearchFieldSpecification()) | |||||
| ->setKey('name') | |||||
| ->setType('string') | |||||
| ->setDescription(pht('The name of the file.')), | |||||
| id(new PhabricatorConduitSearchFieldSpecification()) | |||||
| ->setKey('dataURI') | |||||
| ->setType('string') | |||||
| ->setDescription(pht('Download URI for the file data.')), | |||||
| id(new PhabricatorConduitSearchFieldSpecification()) | |||||
| ->setKey('size') | |||||
| ->setType('int') | |||||
| ->setDescription(pht('File size, in bytes.')), | |||||
| ); | |||||
| } | |||||
| public function getFieldValuesForConduit() { | |||||
| return array( | |||||
| 'name' => $this->getName(), | |||||
| 'dataURI' => $this->getCDNURI(), | |||||
| 'size' => (int)$this->getByteSize(), | |||||
| ); | |||||
| } | |||||
| public function getConduitSearchAttachments() { | |||||
| return array(); | |||||
| } | |||||
| } | } | ||||