@@ -10,7 +10,7 @@ |
||
10 | 10 | private $defaultSort; |
11 | 11 | private $table; |
12 | 12 | |
13 | - public function __construct(DatabaseAdapter $adapter, DatabaseModify $databaseModify, $defaultSort, $table) { |
|
13 | + public function __construct(DatabaseAdapter $adapter, DatabaseModify $databaseModify, $defaultSort, $table) { |
|
14 | 14 | $this->adapter = $adapter; |
15 | 15 | $this->databaseModify = $databaseModify; |
16 | 16 | $this->selectBuilder = new \Maphper\Lib\SelectBuilder(); |
@@ -29,9 +29,9 @@ discard block |
||
29 | 29 | $this->selectBuilder = new \Maphper\Lib\SelectBuilder(); |
30 | 30 | $this->whereBuilder = new \Maphper\Lib\Sql\WhereBuilder(); |
31 | 31 | |
32 | - $this->fields = implode(',', array_map([$this->adapter, 'quote'], (array) $this->options->read('fields'))); |
|
32 | + $this->fields = implode(',', array_map([$this->adapter, 'quote'], (array)$this->options->read('fields'))); |
|
33 | 33 | |
34 | - $defaultSort = $this->options->read('defaultSort') !== false ? $this->options->read('defaultSort') : implode(', ', $this->primaryKey); |
|
34 | + $defaultSort = $this->options->read('defaultSort') !== false ? $this->options->read('defaultSort') : implode(', ', $this->primaryKey); |
|
35 | 35 | $this->databaseModify = new DatabaseModify($this->adapter, $this->options->getEditMode(), $this->table); |
36 | 36 | $this->databaseSelect = new DatabaseSelect($this->adapter, $this->databaseModify, $defaultSort, $this->table); |
37 | 37 | |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | |
152 | 152 | private function updateCache($data) { |
153 | 153 | $pkValue = $data->{$this->primaryKey[0]}; |
154 | - if (isset($this->cache[$pkValue])) $this->cache[$pkValue] = (object) array_merge((array)$this->cache[$pkValue], (array)$data); |
|
154 | + if (isset($this->cache[$pkValue])) $this->cache[$pkValue] = (object)array_merge((array)$this->cache[$pkValue], (array)$data); |
|
155 | 155 | else $this->cache[$pkValue] = $data; |
156 | 156 | } |
157 | 157 |
@@ -17,6 +17,6 @@ |
||
17 | 17 | } |
18 | 18 | |
19 | 19 | public function optimizeColumns() { |
20 | - if (Database::EDIT_OPTIMISE & $this->alterDb && rand(0,500) == 1) $this->adapter->optimiseColumns($this->table); |
|
20 | + if (Database::EDIT_OPTIMISE & $this->alterDb && rand(0, 500) == 1) $this->adapter->optimiseColumns($this->table); |
|
21 | 21 | } |
22 | 22 | } |