Changeset View
Changeset View
Standalone View
Standalone View
src/applications/almanac/storage/AlmanacBinding.php
| <?php | <?php | ||||
| final class AlmanacBinding | final class AlmanacBinding | ||||
| extends AlmanacDAO | extends AlmanacDAO | ||||
| implements | implements | ||||
| PhabricatorPolicyInterface, | PhabricatorPolicyInterface, | ||||
| PhabricatorApplicationTransactionInterface, | PhabricatorApplicationTransactionInterface, | ||||
| AlmanacPropertyInterface, | AlmanacPropertyInterface, | ||||
| PhabricatorDestructibleInterface, | PhabricatorDestructibleInterface, | ||||
| PhabricatorExtendedPolicyInterface { | PhabricatorExtendedPolicyInterface, | ||||
| PhabricatorConduitResultInterface { | |||||
| protected $servicePHID; | protected $servicePHID; | ||||
| protected $devicePHID; | protected $devicePHID; | ||||
| protected $interfacePHID; | protected $interfacePHID; | ||||
| protected $mailKey; | protected $mailKey; | ||||
| protected $isDisabled; | protected $isDisabled; | ||||
| private $service = self::ATTACHABLE; | private $service = self::ATTACHABLE; | ||||
| private $device = self::ATTACHABLE; | private $device = self::ATTACHABLE; | ||||
| private $interface = self::ATTACHABLE; | private $interface = self::ATTACHABLE; | ||||
| private $almanacProperties = self::ATTACHABLE; | private $almanacProperties = self::ATTACHABLE; | ||||
| public static function initializeNewBinding(AlmanacService $service) { | public static function initializeNewBinding(AlmanacService $service) { | ||||
| return id(new AlmanacBinding()) | return id(new AlmanacBinding()) | ||||
| ->setServicePHID($service->getPHID()) | ->setServicePHID($service->getPHID()) | ||||
| ->attachService($service) | |||||
| ->attachAlmanacProperties(array()) | ->attachAlmanacProperties(array()) | ||||
| ->setIsDisabled(0); | ->setIsDisabled(0); | ||||
| } | } | ||||
| protected function getConfiguration() { | protected function getConfiguration() { | ||||
| return array( | return array( | ||||
| self::CONFIG_AUX_PHID => true, | self::CONFIG_AUX_PHID => true, | ||||
| self::CONFIG_COLUMN_SCHEMA => array( | self::CONFIG_COLUMN_SCHEMA => array( | ||||
| ▲ Show 20 Lines • Show All 186 Lines • ▼ Show 20 Lines | /* -( PhabricatorDestructibleInterface )----------------------------------- */ | ||||
| public function destroyObjectPermanently( | public function destroyObjectPermanently( | ||||
| PhabricatorDestructionEngine $engine) { | PhabricatorDestructionEngine $engine) { | ||||
| $this->delete(); | $this->delete(); | ||||
| } | } | ||||
| /* -( PhabricatorConduitResultInterface )---------------------------------- */ | |||||
| public function getFieldSpecificationsForConduit() { | |||||
| return array( | |||||
| id(new PhabricatorConduitSearchFieldSpecification()) | |||||
| ->setKey('servicePHID') | |||||
| ->setType('phid') | |||||
| ->setDescription(pht('The bound service.')), | |||||
| id(new PhabricatorConduitSearchFieldSpecification()) | |||||
| ->setKey('devicePHID') | |||||
| ->setType('phid') | |||||
| ->setDescription(pht('The device the service is bound to.')), | |||||
| id(new PhabricatorConduitSearchFieldSpecification()) | |||||
| ->setKey('interfacePHID') | |||||
| ->setType('phid') | |||||
| ->setDescription(pht('The interface the service is bound to.')), | |||||
| ); | |||||
| } | |||||
| public function getFieldValuesForConduit() { | |||||
| return array( | |||||
| 'servicePHID' => $this->getServicePHID(), | |||||
| 'devicePHID' => $this->getDevicePHID(), | |||||
| 'interfacePHID' => $this->getInterfacePHID(), | |||||
| ); | |||||
| } | |||||
| public function getConduitSearchAttachments() { | |||||
| return array(); | |||||
| } | |||||
| } | } | ||||