@@ -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 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | if (!is_null($probe_res = $this->get($probe_name))) { |
| 46 | 46 | $extract_model->set($column_name, $probe_res); |
| 47 | - } elseif (!$column->is_nullable() && $ignore_nullable===false) { |
|
| 47 | + } elseif (!$column->is_nullable() && $ignore_nullable === false) { |
|
| 48 | 48 | return null; |
| 49 | 49 | } |
| 50 | 50 | } |
@@ -97,15 +97,15 @@ discard block |
||
| 97 | 97 | public function save($operator_id, $tracer = null) : ?array |
| 98 | 98 | { |
| 99 | 99 | try { |
| 100 | - if (!empty($errors=$this->search_and_execute_trait_methods('before_save'))) { |
|
| 100 | + if (!empty($errors = $this->search_and_execute_trait_methods('before_save'))) { |
|
| 101 | 101 | return $errors; |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | - if (!empty($errors=$this->before_save())) { |
|
| 104 | + if (!empty($errors = $this->before_save())) { |
|
| 105 | 105 | return $errors; |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | - if (!empty($errors=$this->validate())) { // Model level validation |
|
| 108 | + if (!empty($errors = $this->validate())) { // Model level validation |
|
| 109 | 109 | return $errors; |
| 110 | 110 | } |
| 111 | 111 | |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | |
| 115 | 115 | |
| 116 | 116 | if ($table_row->is_altered()) { // someting to save ? |
| 117 | - if (!empty($persistence_errors=$table_row->persist())) { // validate and persist |
|
| 117 | + if (!empty($persistence_errors = $table_row->persist())) { // validate and persist |
|
| 118 | 118 | $errors = []; |
| 119 | 119 | foreach ($persistence_errors as $column_name => $err) { |
| 120 | 120 | $errors[sprintf('MODEL_%s_FIELD_%s', static::model_type(), $column_name)] = $err; |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | */ |
| 214 | 214 | public static function one($arg1, $arg2 = null) |
| 215 | 215 | { |
| 216 | - $mixed_info = is_null($arg2)? $arg1 : [$arg1=>$arg2]; |
|
| 216 | + $mixed_info = is_null($arg2) ? $arg1 : [$arg1=>$arg2]; |
|
| 217 | 217 | |
| 218 | 218 | $unique_identifiers = get_called_class()::table()->match_uniqueness($mixed_info); |
| 219 | 219 | |
@@ -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) |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | public function get_id($mode = null) |
| 18 | 18 | { |
| 19 | 19 | $primary_key = static::table()->auto_incremented_primary_key(); |
| 20 | - if (is_null($primary_key) && count($pks = static::table()->primary_keys())==1) { |
|
| 20 | + if (is_null($primary_key) && count($pks = static::table()->primary_keys()) == 1) { |
|
| 21 | 21 | $primary_key = current($pks); |
| 22 | 22 | } |
| 23 | 23 | |