Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/infrastructure/edges/conduit/PhabricatorEdgeObject.php
12241 views
1
<?php
2
3
final class PhabricatorEdgeObject
4
extends Phobject
5
implements PhabricatorPolicyInterface {
6
7
private $id;
8
private $src;
9
private $dst;
10
private $type;
11
private $dateCreated;
12
private $sequence;
13
14
public static function newFromRow(array $row) {
15
$edge = new self();
16
17
$edge->id = idx($row, 'id');
18
$edge->src = idx($row, 'src');
19
$edge->dst = idx($row, 'dst');
20
$edge->type = idx($row, 'type');
21
$edge->dateCreated = idx($row, 'dateCreated');
22
$edge->sequence = idx($row, 'seq');
23
24
return $edge;
25
}
26
27
public function getID() {
28
return $this->id;
29
}
30
31
public function getSourcePHID() {
32
return $this->src;
33
}
34
35
public function getEdgeType() {
36
return $this->type;
37
}
38
39
public function getDestinationPHID() {
40
return $this->dst;
41
}
42
43
public function getPHID() {
44
return null;
45
}
46
47
public function getDateCreated() {
48
return $this->dateCreated;
49
}
50
51
public function getSequence() {
52
return $this->sequence;
53
}
54
55
56
/* -( PhabricatorPolicyInterface )----------------------------------------- */
57
58
59
public function getCapabilities() {
60
return array(
61
PhabricatorPolicyCapability::CAN_VIEW,
62
);
63
}
64
65
public function getPolicy($capability) {
66
switch ($capability) {
67
case PhabricatorPolicyCapability::CAN_VIEW:
68
return PhabricatorPolicies::getMostOpenPolicy();
69
}
70
}
71
72
public function hasAutomaticCapability($capability, PhabricatorUser $viewer) {
73
return false;
74
}
75
76
}
77
78