2012-02-17 19:21:38 +01:00
|
|
|
<?php
|
|
|
|
|
2012-06-02 23:00:08 +02:00
|
|
|
final class PhabricatorChatLogEvent
|
|
|
|
extends PhabricatorChatLogDAO
|
|
|
|
implements PhabricatorPolicyInterface {
|
2012-02-17 19:21:38 +01:00
|
|
|
|
2013-02-14 21:27:08 +01:00
|
|
|
protected $channelID;
|
2012-02-17 19:21:38 +01:00
|
|
|
protected $epoch;
|
|
|
|
protected $author;
|
|
|
|
protected $type;
|
|
|
|
protected $message;
|
|
|
|
protected $loggedByPHID;
|
|
|
|
|
2014-04-10 20:45:21 +02:00
|
|
|
private $channel = self::ATTACHABLE;
|
|
|
|
|
|
|
|
public function getConfiguration() {
|
|
|
|
return array(
|
|
|
|
self::CONFIG_TIMESTAMPS => false,
|
2014-09-18 20:15:29 +02:00
|
|
|
self::CONFIG_COLUMN_SCHEMA => array(
|
|
|
|
'author' => 'text64',
|
|
|
|
'type' => 'text4',
|
|
|
|
'message' => 'text',
|
|
|
|
),
|
2014-10-01 16:53:50 +02:00
|
|
|
self::CONFIG_KEY_SCHEMA => array(
|
|
|
|
'channel' => array(
|
|
|
|
'columns' => array('epoch'),
|
|
|
|
),
|
|
|
|
),
|
2014-04-10 20:45:21 +02:00
|
|
|
) + parent::getConfiguration();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function attachChannel(PhabricatorChatLogChannel $channel) {
|
|
|
|
$this->channel = $channel;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getChannel() {
|
|
|
|
return $this->assertAttached($this->channel);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* -( PhabricatorPolicyInterface )----------------------------------------- */
|
|
|
|
|
|
|
|
|
2012-06-02 23:00:08 +02:00
|
|
|
public function getCapabilities() {
|
|
|
|
return array(
|
|
|
|
PhabricatorPolicyCapability::CAN_VIEW,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getPolicy($capability) {
|
2014-04-10 20:45:21 +02:00
|
|
|
return $this->getChannel()->getPolicy($capability);
|
2012-06-02 23:00:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function hasAutomaticCapability($capability, PhabricatorUser $viewer) {
|
2014-04-10 20:45:21 +02:00
|
|
|
return $this->getChannel()->hasAutomaticCapability($capability, $viewer);
|
2012-06-02 23:00:08 +02:00
|
|
|
}
|
|
|
|
|
2013-09-27 17:43:41 +02:00
|
|
|
public function describeAutomaticCapability($capability) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2012-02-17 19:21:38 +01:00
|
|
|
}
|