/** * Execute query * @param bool $ac If set true will be returned array of EMongoDocuments if not hen array * of CBSONDocument * @return array */ public function queryAll($ac = false) : array { $finded = $this->model->getCollection()->find($this->query, $this->options); $finded = iterator_to_array($finded); if ($ac === true) { return $this->model->populateRecords($finded, true, null, false); } return $finded; }