@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | * таблица для сущности |
| 24 | 24 | * @var type |
| 25 | 25 | */ |
| 26 | - protected $entityTable; |
|
| 26 | + protected $entityTable; |
|
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | 29 | * первичный ключ |
@@ -98,9 +98,9 @@ discard block |
||
| 98 | 98 | |
| 99 | 99 | abstract protected function setMappingFields(); |
| 100 | 100 | |
| 101 | - public function getAdapter() { |
|
| 102 | - return $this->adapter; |
|
| 103 | - } |
|
| 101 | + public function getAdapter() { |
|
| 102 | + return $this->adapter; |
|
| 103 | + } |
|
| 104 | 104 | |
| 105 | 105 | public function setAdapter(QueryBuilderInterface $adapter){ |
| 106 | 106 | $this->adapter = $adapter; |
@@ -123,12 +123,12 @@ discard block |
||
| 123 | 123 | * @param type $id |
| 124 | 124 | * @return type |
| 125 | 125 | */ |
| 126 | - public function findById($id) |
|
| 127 | - { |
|
| 126 | + public function findById($id) |
|
| 127 | + { |
|
| 128 | 128 | $Criteria = (new Specification())->setWhere($this->key , $id); |
| 129 | 129 | |
| 130 | - return $this->findBySpecification($Criteria); |
|
| 131 | - } |
|
| 130 | + return $this->findBySpecification($Criteria); |
|
| 131 | + } |
|
| 132 | 132 | |
| 133 | 133 | /** |
| 134 | 134 | * Сохранение сущности без спобытий |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | */ |
| 257 | 257 | protected function buildEntity(EntityInterface $Entity, array $row){ |
| 258 | 258 | |
| 259 | - foreach ($this->mapping_fields as $alias => $cfg ) { |
|
| 259 | + foreach ($this->mapping_fields as $alias => $cfg ) { |
|
| 260 | 260 | |
| 261 | 261 | $value = false; |
| 262 | 262 | |
@@ -299,9 +299,9 @@ discard block |
||
| 299 | 299 | if($value!==false) |
| 300 | 300 | $Entity->{$method_set}($value); |
| 301 | 301 | |
| 302 | - } |
|
| 302 | + } |
|
| 303 | 303 | |
| 304 | - return $Entity; |
|
| 304 | + return $Entity; |
|
| 305 | 305 | } |
| 306 | 306 | |
| 307 | 307 | |
@@ -315,7 +315,7 @@ discard block |
||
| 315 | 315 | |
| 316 | 316 | $row = []; |
| 317 | 317 | |
| 318 | - foreach ($this->mapping_fields as $alias => $cfg ) { |
|
| 318 | + foreach ($this->mapping_fields as $alias => $cfg ) { |
|
| 319 | 319 | |
| 320 | 320 | $field = $cfg['field']; |
| 321 | 321 | |
@@ -345,9 +345,9 @@ discard block |
||
| 345 | 345 | |
| 346 | 346 | $row[$field] = $value; |
| 347 | 347 | |
| 348 | - } |
|
| 348 | + } |
|
| 349 | 349 | |
| 350 | - return $row; |
|
| 350 | + return $row; |
|
| 351 | 351 | } |
| 352 | 352 | |
| 353 | 353 | /** |
@@ -431,9 +431,9 @@ discard block |
||
| 431 | 431 | //получение записей |
| 432 | 432 | $res = $this->getAdapter()->getResultQuery($this->getEntityTable(),$specification); |
| 433 | 433 | |
| 434 | - if (!$row = $res->row_array()) { |
|
| 435 | - return null; |
|
| 436 | - } |
|
| 434 | + if (!$row = $res->row_array()) { |
|
| 435 | + return null; |
|
| 436 | + } |
|
| 437 | 437 | |
| 438 | 438 | if($this->result_array===true){ |
| 439 | 439 | return $row; |
@@ -482,8 +482,8 @@ discard block |
||
| 482 | 482 | $res = $this->getAdapter()->getResultQuery($this->getEntityTable(),$specification); |
| 483 | 483 | |
| 484 | 484 | if (!$rows = $res->result_array()) { |
| 485 | - return null; |
|
| 486 | - } |
|
| 485 | + return null; |
|
| 486 | + } |
|
| 487 | 487 | |
| 488 | 488 | if($this->result_array===true){ |
| 489 | 489 | return $rows; |