@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | * таблица для сущности |
| 20 | 20 | * @var type |
| 21 | 21 | */ |
| 22 | - protected $entityTable; |
|
| 22 | + protected $entityTable; |
|
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | 25 | * первичный ключ |
@@ -88,9 +88,9 @@ discard block |
||
| 88 | 88 | |
| 89 | 89 | abstract protected function setMappingFields(); |
| 90 | 90 | |
| 91 | - public function getAdapter() { |
|
| 92 | - return $this->adapter; |
|
| 93 | - } |
|
| 91 | + public function getAdapter() { |
|
| 92 | + return $this->adapter; |
|
| 93 | + } |
|
| 94 | 94 | |
| 95 | 95 | public function setAdapter(QueryBuilderInterface $adapter){ |
| 96 | 96 | $this->adapter = $adapter; |
@@ -109,12 +109,12 @@ discard block |
||
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | |
| 112 | - public function findById($id) |
|
| 113 | - { |
|
| 112 | + public function findById($id) |
|
| 113 | + { |
|
| 114 | 114 | $Criteria = (new Specification())->setWhere($this->key , $id); |
| 115 | 115 | |
| 116 | - return $this->findBySpecification($Criteria); |
|
| 117 | - } |
|
| 116 | + return $this->findBySpecification($Criteria); |
|
| 117 | + } |
|
| 118 | 118 | |
| 119 | 119 | /** |
| 120 | 120 | * Cохранение сущности |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | */ |
| 211 | 211 | protected function buildEntity(EntityInterface $Entity, array $row){ |
| 212 | 212 | |
| 213 | - foreach ($this->mapping_fields as $alias => $cfg ) { |
|
| 213 | + foreach ($this->mapping_fields as $alias => $cfg ) { |
|
| 214 | 214 | |
| 215 | 215 | $value = false; |
| 216 | 216 | |
@@ -247,9 +247,9 @@ discard block |
||
| 247 | 247 | if($value!==false) |
| 248 | 248 | $Entity->{$method_set}($value); |
| 249 | 249 | |
| 250 | - } |
|
| 250 | + } |
|
| 251 | 251 | |
| 252 | - return $Entity; |
|
| 252 | + return $Entity; |
|
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | |
| 264 | 264 | $row = []; |
| 265 | 265 | |
| 266 | - foreach ($this->mapping_fields as $alias => $cfg ) { |
|
| 266 | + foreach ($this->mapping_fields as $alias => $cfg ) { |
|
| 267 | 267 | |
| 268 | 268 | $field = $cfg['field']; |
| 269 | 269 | |
@@ -293,9 +293,9 @@ discard block |
||
| 293 | 293 | |
| 294 | 294 | $row[$field] = $value; |
| 295 | 295 | |
| 296 | - } |
|
| 296 | + } |
|
| 297 | 297 | |
| 298 | - return $row; |
|
| 298 | + return $row; |
|
| 299 | 299 | } |
| 300 | 300 | |
| 301 | 301 | /** |
@@ -367,10 +367,10 @@ discard block |
||
| 367 | 367 | //получение записей |
| 368 | 368 | $res = $this->getAdapter()->getResultQuery($this->getEntityTable(),$specification); |
| 369 | 369 | |
| 370 | - if (!$row = $res->row_array()) { |
|
| 371 | - return null; |
|
| 372 | - } |
|
| 373 | - return $this->createEntity($row); |
|
| 370 | + if (!$row = $res->row_array()) { |
|
| 371 | + return null; |
|
| 372 | + } |
|
| 373 | + return $this->createEntity($row); |
|
| 374 | 374 | } |
| 375 | 375 | |
| 376 | 376 | /** |
@@ -412,8 +412,8 @@ discard block |
||
| 412 | 412 | $res = $this->getAdapter()->getResultQuery($this->getEntityTable(),$specification); |
| 413 | 413 | |
| 414 | 414 | if (!$rows = $res->result_array()) { |
| 415 | - return null; |
|
| 416 | - } |
|
| 415 | + return null; |
|
| 416 | + } |
|
| 417 | 417 | |
| 418 | 418 | foreach($rows as $k => $row){ |
| 419 | 419 | $rows[$k] = $this->createEntity($row); |