@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | public function addTerm($object_id, $params) |
| 19 | 19 | { |
| 20 | - foreach($params as $item) { |
|
| 20 | + foreach ($params as $item) { |
|
| 21 | 21 | $term = $this->getTaxonomyTerm($item); |
| 22 | 22 | $data['term_id'] = $term->id; |
| 23 | 23 | $data['object_id'] = $object_id; |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | $this->getDb()->createCommand()->insert($this->table, $data)->execute(); |
| 30 | 30 | |
| 31 | 31 | $term->updateCounters(['total_count' => 1]); |
| 32 | - TaxonomyDef::updateAllCounters(['total_count' => 1], [ 'id' => $this->id ]); |
|
| 32 | + TaxonomyDef::updateAllCounters(['total_count' => 1], ['id' => $this->id]); |
|
| 33 | 33 | |
| 34 | 34 | $transaction->commit(); |
| 35 | 35 | } catch (Exception $e) { |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | |
| 22 | 22 | if ($object_id) { |
| 23 | 23 | $query->innerJoin($this->table, $this->table . '.term_id = taxonomy_terms.id') |
| 24 | - ->onCondition("$this->table.object_id = $object_id"); |
|
| 24 | + ->onCondition("$this->table.object_id = $object_id"); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | return ArrayHelper::getColumn($query->all(), 'term'); |
@@ -16,11 +16,11 @@ discard block |
||
| 16 | 16 | public function getTerms($object_id, $name = []) |
| 17 | 17 | { |
| 18 | 18 | $query = TaxonomyTerms::find() |
| 19 | - ->select(TaxonomyTerms::tableName() . '.term') |
|
| 19 | + ->select(TaxonomyTerms::tableName().'.term') |
|
| 20 | 20 | ->andFilterWhere(['taxonomy_terms.term' => $name]); |
| 21 | 21 | |
| 22 | 22 | if ($object_id) { |
| 23 | - $query->innerJoin($this->table, $this->table . '.term_id = taxonomy_terms.id') |
|
| 23 | + $query->innerJoin($this->table, $this->table.'.term_id = taxonomy_terms.id') |
|
| 24 | 24 | ->onCondition("$this->table.object_id = $object_id"); |
| 25 | 25 | } |
| 26 | 26 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | { |
| 45 | 45 | $cachedParents = []; |
| 46 | 46 | |
| 47 | - $addTerm = function ($parent, $item) use ($object_id, &$cachedParents) { |
|
| 47 | + $addTerm = function($parent, $item) use ($object_id, &$cachedParents) { |
|
| 48 | 48 | if ($this->detectLoop($parent, $item)) { |
| 49 | 49 | throw new InvalidCallException('Loop detected! Cannot add parent as a child!'); |
| 50 | 50 | } |