@@ -67,10 +67,10 @@ |
||
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | /** |
| 70 | - * @return mixed the default value of a field |
|
| 71 | - * @return int for integer and boolean fields |
|
| 72 | - * @return null where no default is set |
|
| 73 | - */ |
|
| 70 | + * @return mixed the default value of a field |
|
| 71 | + * @return int for integer and boolean fields |
|
| 72 | + * @return null where no default is set |
|
| 73 | + */ |
|
| 74 | 74 | public function default() |
| 75 | 75 | { |
| 76 | 76 | $ret = $this->default_value; |
@@ -94,7 +94,7 @@ |
||
| 94 | 94 | |
| 95 | 95 | public function is_primary($setter = null) : bool |
| 96 | 96 | { |
| 97 | - return is_bool($setter)? ($this->primary = $setter) : $this->primary; |
|
| 97 | + return is_bool($setter) ? ($this->primary = $setter) : $this->primary; |
|
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | public function is_foreign($setter = null) : bool |
@@ -67,7 +67,7 @@ |
||
| 67 | 67 | public function add_foreign_key(TableColumnInterface $column) |
| 68 | 68 | { |
| 69 | 69 | $this->foreign_keys_by_table[$column->foreign_table_name()] = $this->foreign_keys_by_table[$column->foreign_table_name()] ?? []; |
| 70 | - $this->foreign_keys_by_table[$column->foreign_table_name()] []= $column; |
|
| 70 | + $this->foreign_keys_by_table[$column->foreign_table_name()] [] = $column; |
|
| 71 | 71 | |
| 72 | 72 | $this->foreign_keys_by_name[$column->name()] = $column; |
| 73 | 73 | } |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | { |
| 18 | 18 | $linked_ids = []; |
| 19 | 19 | foreach ($linked_models as $m) { |
| 20 | - $linked_ids[]=$m->get_id(); |
|
| 20 | + $linked_ids[] = $m->get_id(); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | return static::set_many_by_ids($linked_ids, $m); |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | public function get_id($mode = null) |
| 17 | 17 | { |
| 18 | 18 | $primary_key = static::table()->auto_incremented_primary_key(); |
| 19 | - if (is_null($primary_key) && count($pks = static::table()->primary_keys())==1) { |
|
| 19 | + if (is_null($primary_key) && count($pks = static::table()->primary_keys()) == 1) { |
|
| 20 | 20 | $primary_key = current($pks); |
| 21 | 21 | } |
| 22 | 22 | |