@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | $filter[] = ['doc.'.$attribute, '!=', 'null']; |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | - $aqb = AQB::for('doc', $collection) |
|
| 38 | + $aqb = AQB::for ('doc', $collection) |
|
| 39 | 39 | ->filter($filter) |
| 40 | 40 | ->limit(1) |
| 41 | 41 | ->return('true') |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | ['doc.'.$command->to], |
| 66 | 66 | ]; |
| 67 | 67 | |
| 68 | - $aqb = AQB::for('doc', $collection) |
|
| 68 | + $aqb = AQB::for ('doc', $collection) |
|
| 69 | 69 | ->filter($filter) |
| 70 | 70 | ->update( |
| 71 | 71 | 'doc', |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | $command->to => 'doc.'.$command->from, |
| 75 | 75 | ], |
| 76 | 76 | $collection) |
| 77 | - ->options( ['keepNull' => true]) |
|
| 77 | + ->options(['keepNull' => true]) |
|
| 78 | 78 | ->get(); |
| 79 | 79 | |
| 80 | 80 | $command->aqb = $aqb; |
@@ -101,8 +101,8 @@ discard block |
||
| 101 | 101 | $filter[] = ['doc.'.$attribute, '!=', 'null', 'OR']; |
| 102 | 102 | $data[$attribute] = 'null'; |
| 103 | 103 | } |
| 104 | - $aqb = AQB::for('doc', $collection) |
|
| 105 | - ->filter($filter ) |
|
| 104 | + $aqb = AQB::for ('doc', $collection) |
|
| 105 | + ->filter($filter) |
|
| 106 | 106 | ->update('doc', $data, $collection) |
| 107 | 107 | ->options(['keepNull' => false]) |
| 108 | 108 | ->get(); |
@@ -35,11 +35,12 @@ discard block |
||
| 35 | 35 | $filter[] = ['doc.'.$attribute, '!=', 'null']; |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | - $aqb = AQB::for('doc', $collection) |
|
| 39 | - ->filter($filter) |
|
| 38 | + $aqb = AQB::for('doc', $collection) { |
|
| 39 | + ->filter($filter) |
|
| 40 | 40 | ->limit(1) |
| 41 | 41 | ->return('true') |
| 42 | 42 | ->get(); |
| 43 | + } |
|
| 43 | 44 | |
| 44 | 45 | $command->aqb = $aqb; |
| 45 | 46 | |
@@ -65,8 +66,8 @@ discard block |
||
| 65 | 66 | ['doc.'.$command->to], |
| 66 | 67 | ]; |
| 67 | 68 | |
| 68 | - $aqb = AQB::for('doc', $collection) |
|
| 69 | - ->filter($filter) |
|
| 69 | + $aqb = AQB::for('doc', $collection) { |
|
| 70 | + ->filter($filter) |
|
| 70 | 71 | ->update( |
| 71 | 72 | 'doc', |
| 72 | 73 | [ |
@@ -76,6 +77,7 @@ discard block |
||
| 76 | 77 | $collection) |
| 77 | 78 | ->options( ['keepNull' => true]) |
| 78 | 79 | ->get(); |
| 80 | + } |
|
| 79 | 81 | |
| 80 | 82 | $command->aqb = $aqb; |
| 81 | 83 | |
@@ -101,11 +103,12 @@ discard block |
||
| 101 | 103 | $filter[] = ['doc.'.$attribute, '!=', 'null', 'OR']; |
| 102 | 104 | $data[$attribute] = 'null'; |
| 103 | 105 | } |
| 104 | - $aqb = AQB::for('doc', $collection) |
|
| 105 | - ->filter($filter ) |
|
| 106 | + $aqb = AQB::for('doc', $collection) { |
|
| 107 | + ->filter($filter ) |
|
| 106 | 108 | ->update('doc', $data, $collection) |
| 107 | 109 | ->options(['keepNull' => false]) |
| 108 | 110 | ->get(); |
| 111 | + } |
|
| 109 | 112 | |
| 110 | 113 | $command->aqb = $aqb; |
| 111 | 114 | |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | */ |
| 57 | 57 | protected function registerRepository() |
| 58 | 58 | { |
| 59 | - $this->app->singleton('migration.repository', function ($app) { |
|
| 59 | + $this->app->singleton('migration.repository', function($app) { |
|
| 60 | 60 | $collection = $app['config']['database.migrations']; |
| 61 | 61 | |
| 62 | 62 | return new DatabaseMigrationRepository($app['db'], $collection); |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | protected function registerCreator() |
| 67 | 67 | { |
| 68 | - $this->app->singleton('migration.creator', function ($app) { |
|
| 68 | + $this->app->singleton('migration.creator', function($app) { |
|
| 69 | 69 | return new MigrationCreator($app['files']); |
| 70 | 70 | }); |
| 71 | 71 | } |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | */ |
| 78 | 78 | protected function registerMigrateMakeCommand() |
| 79 | 79 | { |
| 80 | - $this->app->singleton('command.migrate.make', function ($app) { |
|
| 80 | + $this->app->singleton('command.migrate.make', function($app) { |
|
| 81 | 81 | $creator = $app['migration.creator']; |
| 82 | 82 | |
| 83 | 83 | $composer = $app['composer']; |
@@ -88,14 +88,14 @@ discard block |
||
| 88 | 88 | |
| 89 | 89 | protected function registerAranguentConvertMigrationsCommand() |
| 90 | 90 | { |
| 91 | - $this->app->singleton('command.aranguent.convert-migrations', function ($app) { |
|
| 91 | + $this->app->singleton('command.aranguent.convert-migrations', function($app) { |
|
| 92 | 92 | return new AranguentConvertMigrationsCommand($app['migrator']); |
| 93 | 93 | }); |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | protected function registerMakeModelCommand() |
| 97 | 97 | { |
| 98 | - $this->app->singleton('command.model.aranguent', function ($app) { |
|
| 98 | + $this->app->singleton('command.model.aranguent', function($app) { |
|
| 99 | 99 | return new ModelAranguentCommand($app['files']); |
| 100 | 100 | }); |
| 101 | 101 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | return true; |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - if (! is_array(reset($values))) { |
|
| 47 | + if (!is_array(reset($values))) { |
|
| 48 | 48 | $values = [$values]; |
| 49 | 49 | } |
| 50 | 50 | |
@@ -75,16 +75,16 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | protected function updateTimestamps(array $values) |
| 77 | 77 | { |
| 78 | - if (! $this->model->usesTimestamps() || |
|
| 78 | + if (!$this->model->usesTimestamps() || |
|
| 79 | 79 | is_null($this->model->getUpdatedAtColumn()) || |
| 80 | 80 | is_null($this->model->getCreatedAtColumn())) { |
| 81 | 81 | return $values; |
| 82 | 82 | } |
| 83 | - $timestamp = $this->model->freshTimestampString(); |
|
| 83 | + $timestamp = $this->model->freshTimestampString(); |
|
| 84 | 84 | $updatedAtColumn = $this->model->getUpdatedAtColumn(); |
| 85 | 85 | $createdAtColumn = $this->model->getCreatedAtColumn(); |
| 86 | 86 | $timestamps[$updatedAtColumn] = $timestamp; |
| 87 | - if (! isset($values[$createdAtColumn])) { |
|
| 87 | + if (!isset($values[$createdAtColumn])) { |
|
| 88 | 88 | $timestamps[$createdAtColumn] = $timestamp; |
| 89 | 89 | } |
| 90 | 90 | $values = array_merge( |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | */ |
| 119 | 119 | public function get($columns = ['*']) |
| 120 | 120 | { |
| 121 | - $results = collect($this->onceWithColumns(Arr::wrap($columns), function () { |
|
| 121 | + $results = collect($this->onceWithColumns(Arr::wrap($columns), function() { |
|
| 122 | 122 | return $this->runSelect(); |
| 123 | 123 | })); |
| 124 | 124 | return $results; |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | */ |
| 133 | 133 | public function update(array $values) |
| 134 | 134 | { |
| 135 | - $response = $this->connection->update($this->grammar->compileUpdate($this, $values)->aqb); |
|
| 135 | + $response = $this->connection->update($this->grammar->compileUpdate($this, $values)->aqb); |
|
| 136 | 136 | $this->aqb = new QueryBuilder(); |
| 137 | 137 | return $response; |
| 138 | 138 | } |