1: <?php
2: 3: 4:
5:
6: namespace Contentstack\Stack\ContentType\Query;
7:
8: use Contentstack\Stack\ContentType\BaseQuery\BaseQuery;
9: use Contentstack\Utility;
10:
11: require_once __DIR__."/base_query.php";
12: require_once __DIR__."/../utility.php";
13:
14: class Query extends BaseQuery {
15: var $operation;
16: var $_query;
17:
18: 19: 20: 21: 22:
23: public function __construct($contentType = '') {
24: $this->_query = array();
25: parent::__construct($contentType, $this);
26: }
27:
28: 29: 30: 31:
32: public function find() {
33: $this->operation = __FUNCTION__;
34: return Utility\request($this);
35: }
36:
37: 38: 39: 40:
41: public function findOne() {
42: $this->operation = __FUNCTION__;
43: $this->_query['limit'] = 1;
44: return Utility\request($this);
45: }
46: }