[ Index ] |
PHP Cross Reference of Phabricator |
[Summary view] [Print] [Text view]
1 <?php 2 3 final class PhabricatorFlag extends PhabricatorFlagDAO 4 implements PhabricatorPolicyInterface { 5 6 protected $ownerPHID; 7 protected $type; 8 protected $objectPHID; 9 protected $reasonPHID; 10 protected $color = PhabricatorFlagColor::COLOR_BLUE; 11 protected $note; 12 13 private $handle = self::ATTACHABLE; 14 private $object = self::ATTACHABLE; 15 16 public function getConfiguration() { 17 return array( 18 self::CONFIG_COLUMN_SCHEMA => array( 19 'type' => 'text4', 20 'color' => 'uint32', 21 'note' => 'text', 22 ), 23 self::CONFIG_KEY_SCHEMA => array( 24 'ownerPHID' => array( 25 'columns' => array('ownerPHID', 'type', 'objectPHID'), 26 'unique' => true, 27 ), 28 'objectPHID' => array( 29 'columns' => array('objectPHID'), 30 ), 31 ), 32 ) + parent::getConfiguration(); 33 } 34 35 public function getObject() { 36 return $this->assertAttached($this->object); 37 } 38 39 public function attachObject($object) { 40 $this->object = $object; 41 return $this; 42 } 43 44 public function getHandle() { 45 return $this->assertAttached($this->handle); 46 } 47 48 public function attachHandle(PhabricatorObjectHandle $handle) { 49 $this->handle = $handle; 50 return $this; 51 } 52 53 54 /* -( PhabricatorPolicyInterface )----------------------------------------- */ 55 56 57 public function getCapabilities() { 58 return array( 59 PhabricatorPolicyCapability::CAN_VIEW, 60 PhabricatorPolicyCapability::CAN_EDIT, 61 ); 62 } 63 64 public function getPolicy($capability) { 65 return PhabricatorPolicies::POLICY_NOONE; 66 } 67 68 public function hasAutomaticCapability($capability, PhabricatorUser $viewer) { 69 return ($viewer->getPHID() == $this->getOwnerPHID()); 70 } 71 72 public function describeAutomaticCapability($capability) { 73 return pht('Flags are private. Only you can view or edit your flags.'); 74 } 75 76 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Sun Nov 30 09:20:46 2014 | Cross-referenced by PHPXref 0.7.1 |