1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-13 10:22:42 +01:00
phorge-phorge/src/applications/almanac/storage/AlmanacProperty.php

57 lines
1.3 KiB
PHP
Raw Normal View History

2014-11-06 00:27:16 +01:00
<?php
final class AlmanacProperty
extends PhabricatorCustomFieldStorage
implements PhabricatorPolicyInterface {
protected $fieldName;
private $object = self::ATTACHABLE;
public function getApplicationName() {
return 'almanac';
}
protected function getConfiguration() {
2014-11-06 00:27:16 +01:00
$config = parent::getConfiguration();
$config[self::CONFIG_COLUMN_SCHEMA] += array(
'fieldName' => 'text128',
);
return $config;
}
public function getObject() {
return $this->assertAttached($this->object);
}
public function attachObject(PhabricatorLiskDAO $object) {
$this->object = $object;
return $this;
}
/* -( PhabricatorPolicyInterface )----------------------------------------- */
public function getCapabilities() {
return array(
PhabricatorPolicyCapability::CAN_VIEW,
PhabricatorPolicyCapability::CAN_EDIT,
);
}
public function getPolicy($capability) {
return $this->getObject()->getPolicy($capability);
}
public function hasAutomaticCapability($capability, PhabricatorUser $viewer) {
return $this->getObject()->hasAutomaticCapability($capability, $viewer);
}
public function describeAutomaticCapability($capability) {
return pht('Properties inherit the policies of their object.');
}
}