From eb5e18dfd6fbd32af0e9dabedc25b0cbc1b6b880 Mon Sep 17 00:00:00 2001 From: Arsen Mirzaev Tatyano-Muradovich Date: Sun, 11 Apr 2021 03:30:56 +1000 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B8?= =?UTF-8?q?=20=D0=B2=20genQuery()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mirzaev/yii2/arangodb/Query.php | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/mirzaev/yii2/arangodb/Query.php b/mirzaev/yii2/arangodb/Query.php index 8545b5d..49892ba 100644 --- a/mirzaev/yii2/arangodb/Query.php +++ b/mirzaev/yii2/arangodb/Query.php @@ -820,22 +820,22 @@ class Query extends Component implements QueryInterface { // Инициализация $query ?? $query = $this; - $this->in ?? $this->in = $this->collection ?? throw new Exception('Не найдена коллекция'); - $this->for ?? $this->for = $this->in; - $this->collection ?? $this->collection = is_array($this->for) ? $this->in : $this->for; + $query->in ?? $query->in = $query->collection ?? throw new Exception('Не найдена коллекция'); + $query->for ?? $query->for = $query->in; + $query->collection ?? $query->collection = $query->in; $params = array_merge($params, $query->params); $clauses = [ - static::genFor($query->for), - static::genIn($query->in, $query->traversals), - static::genLet($query->lets), - $this->genForeach($query->foreach), - $this->genWhere($query->where, $params), - isset($this->search) ? $this->genSearch($this->search, $this->searchType) : null, - $this->genOrderBy($query->orderBy, $params), - $this->genLimit($query->limit, $query->offset, $params), - $this->genSelect($query->select, $params), + $query::genFor($query->for), + $query::genIn($query->in, $query->traversals), + $query::genLet($query->lets), + $query->genForeach($query->foreach), + $query->genWhere($query->where, $params), + isset($query->search) ? $query->genSearch($query->search, $query->searchType) : null, + $query->genOrderBy($query->orderBy, $params), + $query->genLimit($query->limit, $query->offset, $params), + $query->genSelect($query->select, $params), ]; $aql = implode($query->separator, array_filter($clauses)); @@ -928,8 +928,8 @@ class Query extends Component implements QueryInterface public function insert($columns, $params = [], $db = null) { // Инициализация - $this->in ?? (isset($this->collection) ? $this->in = $this->collection : throw new Exception('Не найдена коллекция')); - $this->collection ?? $this->collection = is_array($this->for) ? $this->in : $this->for; + $this->in ?? $this->in = $this->collection ?? throw new Exception('Не найдена коллекция'); + $this->collection ?? $this->collection = $this->in ; $data = Serializer::encode($columns); @@ -976,7 +976,7 @@ class Query extends Component implements QueryInterface // Инициализация $this->in ?? $this->in = $this->collection ?? throw new Exception('Не найдена коллекция'); $this->for ?? $this->for = $this->in; - $this->collection ?? $this->collection = is_array($this->for) ? $this->in : $this->for; + $this->collection ?? $this->collection = $this->in; $clauses = [ static::genFor($this->for), @@ -1028,7 +1028,7 @@ class Query extends Component implements QueryInterface // Инициализация $this->in ?? $this->in = $this->collection ?? throw new Exception('Не найдена коллекция'); $this->for ?? $this->for = $this->in; - $this->collection ?? $this->collection = is_array($this->for) ? $this->in : $this->for; + $this->collection ?? $this->collection = $this->in; $clauses = [ static::genFor($this->for),