2013-05-20 19:18:26 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class DivinerLiveBook extends DivinerDAO
|
|
|
|
implements PhabricatorPolicyInterface {
|
|
|
|
|
|
|
|
protected $phid;
|
|
|
|
protected $name;
|
|
|
|
protected $viewPolicy;
|
2013-06-04 20:15:34 +02:00
|
|
|
protected $configurationData = array();
|
2013-05-20 19:18:26 +02:00
|
|
|
|
|
|
|
public function getConfiguration() {
|
|
|
|
return array(
|
|
|
|
self::CONFIG_AUX_PHID => true,
|
2013-06-04 20:15:34 +02:00
|
|
|
self::CONFIG_SERIALIZATION => array(
|
|
|
|
'configurationData' => self::SERIALIZATION_JSON,
|
|
|
|
),
|
2013-05-20 19:18:26 +02:00
|
|
|
) + parent::getConfiguration();
|
|
|
|
}
|
|
|
|
|
2013-06-04 20:15:34 +02:00
|
|
|
public function getConfig($key, $default = null) {
|
|
|
|
return idx($this->configurationData, $key, $default);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setConfig($key, $value) {
|
|
|
|
$this->configurationData[$key] = $value;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2013-05-20 19:18:26 +02:00
|
|
|
public function generatePHID() {
|
|
|
|
return PhabricatorPHID::generateNewPHID(
|
|
|
|
PhabricatorPHIDConstants::PHID_TYPE_BOOK);
|
|
|
|
}
|
|
|
|
|
2013-06-04 20:15:34 +02:00
|
|
|
public function getTitle() {
|
|
|
|
return $this->getConfig('title', $this->getName());
|
|
|
|
}
|
|
|
|
|
2013-05-20 19:18:26 +02:00
|
|
|
/* -( PhabricatorPolicyInterface )----------------------------------------- */
|
|
|
|
|
|
|
|
public function getCapabilities() {
|
|
|
|
return array(
|
|
|
|
PhabricatorPolicyCapability::CAN_VIEW,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getPolicy($capability) {
|
|
|
|
return $this->viewPolicy;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function hasAutomaticCapability($capability, PhabricatorUser $viewer) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|