Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / chatlog / storage / PhabricatorChatLogEvent.php
bloba510c333dc7362d1517f38aee75e1d5bb3fd4483
1 <?php
3 final class PhabricatorChatLogEvent
4 extends PhabricatorChatLogDAO
5 implements PhabricatorPolicyInterface {
7 protected $channelID;
8 protected $epoch;
9 protected $author;
10 protected $type;
11 protected $message;
12 protected $loggedByPHID;
14 private $channel = self::ATTACHABLE;
16 protected function getConfiguration() {
17 return array(
18 self::CONFIG_TIMESTAMPS => false,
19 self::CONFIG_COLUMN_SCHEMA => array(
20 'author' => 'text64',
21 'type' => 'text4',
22 'message' => 'text',
24 self::CONFIG_KEY_SCHEMA => array(
25 'channel' => array(
26 'columns' => array('epoch'),
29 ) + parent::getConfiguration();
32 public function attachChannel(PhabricatorChatLogChannel $channel) {
33 $this->channel = $channel;
34 return $this;
37 public function getChannel() {
38 return $this->assertAttached($this->channel);
42 /* -( PhabricatorPolicyInterface )----------------------------------------- */
45 public function getCapabilities() {
46 return array(
47 PhabricatorPolicyCapability::CAN_VIEW,
51 public function getPolicy($capability) {
52 return $this->getChannel()->getPolicy($capability);
55 public function hasAutomaticCapability($capability, PhabricatorUser $viewer) {
56 return $this->getChannel()->hasAutomaticCapability($capability, $viewer);