Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/calendar/storage/PhabricatorCalendarImportLog.php
12253 views
1
<?php
2
3
final class PhabricatorCalendarImportLog
4
extends PhabricatorCalendarDAO
5
implements
6
PhabricatorPolicyInterface,
7
PhabricatorDestructibleInterface {
8
9
protected $importPHID;
10
protected $parameters = array();
11
12
private $import = self::ATTACHABLE;
13
private $logType = self::ATTACHABLE;
14
15
protected function getConfiguration() {
16
return array(
17
self::CONFIG_SERIALIZATION => array(
18
'parameters' => self::SERIALIZATION_JSON,
19
),
20
self::CONFIG_KEY_SCHEMA => array(
21
'key_import' => array(
22
'columns' => array('importPHID'),
23
),
24
),
25
) + parent::getConfiguration();
26
}
27
28
public function getParameter($key, $default = null) {
29
return idx($this->parameters, $key, $default);
30
}
31
32
public function setParameter($key, $value) {
33
$this->parameters[$key] = $value;
34
return $this;
35
}
36
37
public function getImport() {
38
return $this->assertAttached($this->import);
39
}
40
41
public function attachImport(PhabricatorCalendarImport $import) {
42
$this->import = $import;
43
return $this;
44
}
45
46
public function getDisplayIcon(PhabricatorUser $viewer) {
47
return $this->getLogType()->getDisplayIcon($viewer, $this);
48
}
49
50
public function getDisplayColor(PhabricatorUser $viewer) {
51
return $this->getLogType()->getDisplayColor($viewer, $this);
52
}
53
54
public function getDisplayType(PhabricatorUser $viewer) {
55
return $this->getLogType()->getDisplayType($viewer, $this);
56
}
57
58
public function getDisplayDescription(PhabricatorUser $viewer) {
59
return $this->getLogType()->getDisplayDescription($viewer, $this);
60
}
61
62
public function getLogType() {
63
return $this->assertAttached($this->logType);
64
}
65
66
public function attachLogType(PhabricatorCalendarImportLogType $type) {
67
$this->logType = $type;
68
return $this;
69
}
70
71
72
/* -( PhabricatorPolicyInterface )----------------------------------------- */
73
74
75
public function getCapabilities() {
76
return array(
77
PhabricatorPolicyCapability::CAN_VIEW,
78
);
79
}
80
81
public function getPolicy($capability) {
82
return PhabricatorPolicies::getMostOpenPolicy();
83
}
84
85
public function hasAutomaticCapability($capability, PhabricatorUser $viewer) {
86
return false;
87
}
88
89
90
/* -( PhabricatorDestructibleInterface )----------------------------------- */
91
92
93
public function destroyObjectPermanently(
94
PhabricatorDestructionEngine $engine) {
95
$viewer = $engine->getViewer();
96
$this->delete();
97
}
98
99
}
100
101