Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/infrastructure/query/policy/PhabricatorQueryCursor.php
12242 views
1
<?php
2
3
final class PhabricatorQueryCursor
4
extends Phobject {
5
6
private $object;
7
private $rawRow;
8
9
public function setObject($object) {
10
$this->object = $object;
11
return $this;
12
}
13
14
public function getObject() {
15
return $this->object;
16
}
17
18
public function setRawRow(array $raw_row) {
19
$this->rawRow = $raw_row;
20
return $this;
21
}
22
23
public function getRawRow() {
24
return $this->rawRow;
25
}
26
27
public function getRawRowProperty($key) {
28
if (!is_array($this->rawRow)) {
29
throw new Exception(
30
pht(
31
'Caller is trying to "getRawRowProperty()" with key "%s", but this '.
32
'cursor has no raw row.',
33
$key));
34
}
35
36
if (!array_key_exists($key, $this->rawRow)) {
37
throw new Exception(
38
pht(
39
'Caller is trying to access raw row property "%s", but the row '.
40
'does not have this property.',
41
$key));
42
}
43
44
return $this->rawRow[$key];
45
}
46
47
}
48
49