2012-02-17 10:21:38 -08:00
|
|
|
<?php
|
|
|
|
|
2012-06-02 14:00:08 -07:00
|
|
|
final class PhabricatorChatLogEvent
|
|
|
|
extends PhabricatorChatLogDAO
|
|
|
|
implements PhabricatorPolicyInterface {
|
2012-02-17 10:21:38 -08:00
|
|
|
|
2013-02-14 12:27:08 -08:00
|
|
|
protected $channelID;
|
2012-02-17 10:21:38 -08:00
|
|
|
protected $epoch;
|
|
|
|
protected $author;
|
|
|
|
protected $type;
|
|
|
|
protected $message;
|
|
|
|
protected $loggedByPHID;
|
|
|
|
|
2014-04-10 11:45:21 -07:00
|
|
|
private $channel = self::ATTACHABLE;
|
|
|
|
|
2015-01-14 06:47:05 +11:00
|
|
|
protected function getConfiguration() {
|
2014-04-10 11:45:21 -07:00
|
|
|
return array(
|
|
|
|
self::CONFIG_TIMESTAMPS => false,
|
2014-09-18 11:15:29 -07:00
|
|
|
self::CONFIG_COLUMN_SCHEMA => array(
|
|
|
|
'author' => 'text64',
|
|
|
|
'type' => 'text4',
|
|
|
|
'message' => 'text',
|
|
|
|
),
|
2014-10-01 07:53:50 -07:00
|
|
|
self::CONFIG_KEY_SCHEMA => array(
|
|
|
|
'channel' => array(
|
|
|
|
'columns' => array('epoch'),
|
|
|
|
),
|
|
|
|
),
|
2014-04-10 11:45:21 -07: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 14:00:08 -07:00
|
|
|
public function getCapabilities() {
|
|
|
|
return array(
|
|
|
|
PhabricatorPolicyCapability::CAN_VIEW,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getPolicy($capability) {
|
2014-04-10 11:45:21 -07:00
|
|
|
return $this->getChannel()->getPolicy($capability);
|
2012-06-02 14:00:08 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
public function hasAutomaticCapability($capability, PhabricatorUser $viewer) {
|
2014-04-10 11:45:21 -07:00
|
|
|
return $this->getChannel()->hasAutomaticCapability($capability, $viewer);
|
2012-06-02 14:00:08 -07:00
|
|
|
}
|
|
|
|
|
2012-02-17 10:21:38 -08:00
|
|
|
}
|