3 final class PhabricatorFlag
extends PhabricatorFlagDAO
4 implements PhabricatorPolicyInterface
{
10 protected $color = PhabricatorFlagColor
::COLOR_BLUE
;
13 private $handle = self
::ATTACHABLE
;
14 private $object = self
::ATTACHABLE
;
16 protected function getConfiguration() {
18 self
::CONFIG_COLUMN_SCHEMA
=> array(
23 self
::CONFIG_KEY_SCHEMA
=> array(
25 'columns' => array('ownerPHID', 'type', 'objectPHID'),
28 'objectPHID' => array(
29 'columns' => array('objectPHID'),
32 ) + parent
::getConfiguration();
35 public function getObject() {
36 return $this->assertAttached($this->object);
39 public function attachObject($object) {
40 $this->object = $object;
44 public function getHandle() {
45 return $this->assertAttached($this->handle
);
48 public function attachHandle(PhabricatorObjectHandle
$handle) {
49 $this->handle
= $handle;
54 /* -( PhabricatorPolicyInterface )----------------------------------------- */
57 public function getCapabilities() {
59 PhabricatorPolicyCapability
::CAN_VIEW
,
60 PhabricatorPolicyCapability
::CAN_EDIT
,
64 public function getPolicy($capability) {
65 return PhabricatorPolicies
::POLICY_NOONE
;
68 public function hasAutomaticCapability($capability, PhabricatorUser
$viewer) {
69 return ($viewer->getPHID() == $this->getOwnerPHID());
72 public function describeAutomaticCapability($capability) {
73 return pht('Flags are private. Only you can view or edit your flags.');