@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
at upstream/main 47 lines 952 B view raw
1<?php 2 3final 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}