@@ -266,7 +266,7 @@ |
||
266 | 266 | |
267 | 267 | if ($Query->is_success()) { |
268 | 268 | foreach ($Query->ret_obj(get_called_class()) as $rec) { |
269 | - $ret[$rec->get($pk_name)] = $rec; |
|
269 | + $ret[$rec->get($pk_name)] = $rec; |
|
270 | 270 | } |
271 | 271 | } |
272 | 272 |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | namespace HexMakina\TightORM; |
4 | 4 | |
5 | -use \HexMakina\Crudites\{TableToModel,CruditesException}; |
|
5 | +use \HexMakina\Crudites\{TableToModel, CruditesException}; |
|
6 | 6 | use \HexMakina\Crudites\Interfaces\TableManipulationInterface; |
7 | 7 | use \HexMakina\Crudites\Interfaces\TraceableInterface; |
8 | 8 | use \HexMakina\Crudites\Interfaces\SelectInterface; |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | |
44 | 44 | if (!is_null($probe_res = $this->get($probe_name))) { |
45 | 45 | $extract_model->set($column_name, $probe_res); |
46 | - } elseif (!$column->is_nullable() && $ignore_nullable===false) { |
|
46 | + } elseif (!$column->is_nullable() && $ignore_nullable === false) { |
|
47 | 47 | return null; |
48 | 48 | } |
49 | 49 | } |
@@ -96,15 +96,15 @@ discard block |
||
96 | 96 | public function save($operator_id, $tracer = null) : ?array |
97 | 97 | { |
98 | 98 | try { |
99 | - if (!empty($errors=$this->search_and_execute_trait_methods('before_save'))) { |
|
99 | + if (!empty($errors = $this->search_and_execute_trait_methods('before_save'))) { |
|
100 | 100 | return $errors; |
101 | 101 | } |
102 | 102 | |
103 | - if (!empty($errors=$this->before_save())) { |
|
103 | + if (!empty($errors = $this->before_save())) { |
|
104 | 104 | return $errors; |
105 | 105 | } |
106 | 106 | |
107 | - if (!empty($errors=$this->validate())) { // Model level validation |
|
107 | + if (!empty($errors = $this->validate())) { // Model level validation |
|
108 | 108 | return $errors; |
109 | 109 | } |
110 | 110 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | |
114 | 114 | |
115 | 115 | if ($table_row->is_altered()) { // someting to save ? |
116 | - if (!empty($persistence_errors=$table_row->persist())) { // validate and persist |
|
116 | + if (!empty($persistence_errors = $table_row->persist())) { // validate and persist |
|
117 | 117 | $errors = []; |
118 | 118 | foreach ($persistence_errors as $column_name => $err) { |
119 | 119 | $errors[sprintf('MODEL_%s_FIELD_%s', static::model_type(), $column_name)] = $err; |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | */ |
213 | 213 | public static function one($arg1, $arg2 = null) |
214 | 214 | { |
215 | - $mixed_info = is_null($arg2)? $arg1 : [$arg1=>$arg2]; |
|
215 | + $mixed_info = is_null($arg2) ? $arg1 : [$arg1=>$arg2]; |
|
216 | 216 | |
217 | 217 | $unique_identifiers = get_called_class()::table()->match_uniqueness($mixed_info); |
218 | 218 |
@@ -2,7 +2,7 @@ |
||
2 | 2 | |
3 | 3 | namespace HexMakina\TightORM\Interfaces; |
4 | 4 | |
5 | -use HexMakina\Crudites\Interfaces\{TableManipulationInterface,TracerInterface, SelectInterface}; |
|
5 | +use HexMakina\Crudites\Interfaces\{TableManipulationInterface, TracerInterface, SelectInterface}; |
|
6 | 6 | |
7 | 7 | interface ModelInterface |
8 | 8 | { |
@@ -15,7 +15,7 @@ |
||
15 | 15 | { |
16 | 16 | $linked_ids = []; |
17 | 17 | foreach ($linked_models as $m) { |
18 | - $linked_ids[]=$m->get_id(); |
|
18 | + $linked_ids[] = $m->get_id(); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | return static::set_many_by_ids($linked_ids, $m); |
@@ -96,9 +96,9 @@ |
||
96 | 96 | if (!empty($date_stop)) { |
97 | 97 | $this->statement()->aw_lte($this->model()->event_field(), $date_stop, $this->statement()->table_label(), ':filter_date_stop'); |
98 | 98 | } |
99 | - // |
|
100 | - // if(empty($options['order_by'])) |
|
101 | - // $this->statement()->order_by([$this->model()->event_field(), 'DESC']); |
|
99 | + // |
|
100 | + // if(empty($options['order_by'])) |
|
101 | + // $this->statement()->order_by([$this->model()->event_field(), 'DESC']); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | public function filter_with_ids($ids) |