Changeset View
Changeset View
Standalone View
Standalone View
src/applications/almanac/storage/AlmanacNamespace.php
<?php | <?php | ||||
final class AlmanacNamespace | final class AlmanacNamespace | ||||
extends AlmanacDAO | extends AlmanacDAO | ||||
implements | implements | ||||
PhabricatorPolicyInterface, | PhabricatorPolicyInterface, | ||||
PhabricatorCustomFieldInterface, | |||||
PhabricatorApplicationTransactionInterface, | PhabricatorApplicationTransactionInterface, | ||||
PhabricatorProjectInterface, | PhabricatorProjectInterface, | ||||
AlmanacPropertyInterface, | AlmanacPropertyInterface, | ||||
PhabricatorDestructibleInterface, | PhabricatorDestructibleInterface, | ||||
PhabricatorNgramsInterface { | PhabricatorNgramsInterface { | ||||
protected $name; | protected $name; | ||||
protected $nameIndex; | protected $nameIndex; | ||||
protected $mailKey; | protected $mailKey; | ||||
protected $viewPolicy; | protected $viewPolicy; | ||||
protected $editPolicy; | protected $editPolicy; | ||||
private $customFields = self::ATTACHABLE; | |||||
private $almanacProperties = self::ATTACHABLE; | private $almanacProperties = self::ATTACHABLE; | ||||
public static function initializeNewNamespace() { | public static function initializeNewNamespace() { | ||||
return id(new self()) | return id(new self()) | ||||
->setViewPolicy(PhabricatorPolicies::POLICY_USER) | ->setViewPolicy(PhabricatorPolicies::POLICY_USER) | ||||
->setEditPolicy(PhabricatorPolicies::POLICY_ADMIN) | ->setEditPolicy(PhabricatorPolicies::POLICY_ADMIN) | ||||
->attachAlmanacProperties(array()); | ->attachAlmanacProperties(array()); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 114 Lines • ▼ Show 20 Lines | if ($this->hasAlmanacProperty($key)) { | ||||
return $default; | return $default; | ||||
} | } | ||||
} | } | ||||
public function getAlmanacPropertyFieldSpecifications() { | public function getAlmanacPropertyFieldSpecifications() { | ||||
return array(); | return array(); | ||||
} | } | ||||
public function newAlmanacPropertyEditEngine() { | |||||
throw new PhutilMethodNotImplementedException(); | |||||
} | |||||
/* -( PhabricatorPolicyInterface )----------------------------------------- */ | /* -( PhabricatorPolicyInterface )----------------------------------------- */ | ||||
public function getCapabilities() { | public function getCapabilities() { | ||||
return array( | return array( | ||||
PhabricatorPolicyCapability::CAN_VIEW, | PhabricatorPolicyCapability::CAN_VIEW, | ||||
PhabricatorPolicyCapability::CAN_EDIT, | PhabricatorPolicyCapability::CAN_EDIT, | ||||
Show All 13 Lines | public function hasAutomaticCapability($capability, PhabricatorUser $viewer) { | ||||
return false; | return false; | ||||
} | } | ||||
public function describeAutomaticCapability($capability) { | public function describeAutomaticCapability($capability) { | ||||
return null; | return null; | ||||
} | } | ||||
/* -( PhabricatorCustomFieldInterface )------------------------------------ */ | |||||
public function getCustomFieldSpecificationForRole($role) { | |||||
return array(); | |||||
} | |||||
public function getCustomFieldBaseClass() { | |||||
return 'AlmanacCustomField'; | |||||
} | |||||
public function getCustomFields() { | |||||
return $this->assertAttached($this->customFields); | |||||
} | |||||
public function attachCustomFields(PhabricatorCustomFieldAttachment $fields) { | |||||
$this->customFields = $fields; | |||||
return $this; | |||||
} | |||||
/* -( PhabricatorApplicationTransactionInterface )------------------------- */ | /* -( PhabricatorApplicationTransactionInterface )------------------------- */ | ||||
public function getApplicationTransactionEditor() { | public function getApplicationTransactionEditor() { | ||||
return new AlmanacNamespaceEditor(); | return new AlmanacNamespaceEditor(); | ||||
} | } | ||||
public function getApplicationTransactionObject() { | public function getApplicationTransactionObject() { | ||||
Show All 34 Lines |