1 | <?php |
||
29 | class View |
||
30 | { |
||
31 | /** @var Bucket */ |
||
32 | protected $bucket; |
||
33 | |||
34 | /** @var Dispatcher */ |
||
35 | protected $dispatcher; |
||
36 | |||
37 | /** |
||
38 | * Specifies the mode of updating to perorm before and after executing the query |
||
39 | * |
||
40 | * @see \Couchbase\ViewQuery::UPDATE_BEFORE |
||
41 | * @see \Couchbase\ViewQuery::UPDATE_NONE |
||
42 | * @see \Couchbase\ViewQuery::UPDATE_AFTER |
||
43 | */ |
||
44 | private $consistency = null; |
||
45 | |||
46 | /** |
||
47 | * View constructor. |
||
48 | * |
||
49 | * @param Bucket $bucket |
||
50 | * @param Dispatcher|null $dispatcher |
||
51 | */ |
||
52 | 2 | public function __construct(Bucket $bucket, Dispatcher $dispatcher = null) |
|
57 | |||
58 | /** |
||
59 | * @param string $designDoc |
||
60 | * @param string $name |
||
61 | * |
||
62 | * @return ViewQuery |
||
63 | */ |
||
64 | 2 | public function from(string $designDoc, string $name): ViewQuery |
|
68 | |||
69 | /** |
||
70 | * @param string $designDoc |
||
71 | * @param string $name |
||
72 | * |
||
73 | * @return SpatialViewQuery |
||
74 | */ |
||
75 | public function fromSpatial(string $designDoc, string $name): SpatialViewQuery |
||
79 | |||
80 | /** |
||
81 | * @param ViewQuery $viewQuery |
||
82 | * @param bool $jsonAsArray |
||
83 | * |
||
84 | * @return mixed |
||
85 | */ |
||
86 | 2 | public function execute(ViewQuery $viewQuery, bool $jsonAsArray = false) |
|
97 | |||
98 | /** |
||
99 | * @param int $consistency |
||
100 | */ |
||
101 | public function consistency(int $consistency): void |
||
105 | } |
||
106 |