@@ -29,7 +29,7 @@ |
||
| 29 | 29 | |
| 30 | 30 | $insertSql = new \Sirius\Sql\Insert($connection); |
| 31 | 31 | $insertSql->into($this->mapper->getConfig()->getTable()) |
| 32 | - ->columns($columns); |
|
| 32 | + ->columns($columns); |
|
| 33 | 33 | $insertSql->perform(); |
| 34 | 34 | |
| 35 | 35 | /** |
@@ -23,10 +23,10 @@ |
||
| 23 | 23 | |
| 24 | 24 | $update = new \Sirius\Sql\Update($this->mapper->getWriteConnection()); |
| 25 | 25 | $update->table($this->mapper->getConfig()->getTable()) |
| 26 | - ->columns([ |
|
| 27 | - $this->getOption('deleted_at_column') => $this->now |
|
| 28 | - ]) |
|
| 29 | - ->where('id', $entityId); |
|
| 26 | + ->columns([ |
|
| 27 | + $this->getOption('deleted_at_column') => $this->now |
|
| 28 | + ]) |
|
| 29 | + ->where('id', $entityId); |
|
| 30 | 30 | $update->perform(); |
| 31 | 31 | } |
| 32 | 32 | |
@@ -122,8 +122,8 @@ |
||
| 122 | 122 | |
| 123 | 123 | $insert = new \Sirius\Sql\Insert($conn); |
| 124 | 124 | $insert->into($throughTable) |
| 125 | - ->columns($insertColumns) |
|
| 126 | - ->perform(); |
|
| 125 | + ->columns($insertColumns) |
|
| 126 | + ->perform(); |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | protected function getNativeEntityHydrator() |
@@ -54,8 +54,8 @@ |
||
| 54 | 54 | if (count($columns) > 0) { |
| 55 | 55 | $updateSql = new \Sirius\Sql\Update($connection); |
| 56 | 56 | $updateSql->table($this->mapper->getConfig()->getTable()) |
| 57 | - ->columns($columns) |
|
| 58 | - ->whereAll($conditions, false); |
|
| 57 | + ->columns($columns) |
|
| 58 | + ->whereAll($conditions, false); |
|
| 59 | 59 | $updateSql->perform(); |
| 60 | 60 | } |
| 61 | 61 | } |
@@ -64,8 +64,8 @@ discard block |
||
| 64 | 64 | private function addFirstMethod() |
| 65 | 65 | { |
| 66 | 66 | $method = $this->class->addMethod('first') |
| 67 | - ->setReturnNullable(true) |
|
| 68 | - ->setReturnType($this->mapper->getEntityClass()); |
|
| 67 | + ->setReturnNullable(true) |
|
| 68 | + ->setReturnType($this->mapper->getEntityClass()); |
|
| 69 | 69 | $method->setBody('return parent::first();'); |
| 70 | 70 | } |
| 71 | 71 | |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | { |
| 74 | 74 | $this->namespace->addUse(Collection::class); |
| 75 | 75 | $method = $this->class->addMethod('get') |
| 76 | - ->setReturnType('Collection'); |
|
| 76 | + ->setReturnType('Collection'); |
|
| 77 | 77 | $method->setBody('return parent::get();'); |
| 78 | 78 | $method->addComment(sprintf('@return Collection|%s[]', $this->mapper->getEntityClass())); |
| 79 | 79 | } |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | { |
| 83 | 83 | $this->namespace->addUse(PaginatedCollection::class); |
| 84 | 84 | $method = $this->class->addMethod('paginate') |
| 85 | - ->setReturnType('PaginatedCollection'); |
|
| 85 | + ->setReturnType('PaginatedCollection'); |
|
| 86 | 86 | $method->addParameter('perPage')->setType('int'); |
| 87 | 87 | $method->addParameter('page', 1)->setType('int'); |
| 88 | 88 | $method->setBody('return parent::paginate($perPage, $page);'); |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | public function joinSubselect(Query $query, string $reference) |
| 49 | 49 | { |
| 50 | 50 | $subselect = $query->subSelectForJoinWith($this->foreignMapper) |
| 51 | - ->as($reference); |
|
| 51 | + ->as($reference); |
|
| 52 | 52 | |
| 53 | 53 | $subselect = $this->applyQueryCallback($subselect); |
| 54 | 54 | |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | public function joinSubselect(Query $query, string $reference) |
| 49 | 49 | { |
| 50 | 50 | $subselect = $query->subSelectForJoinWith($this->foreignMapper) |
| 51 | - ->as($reference); |
|
| 51 | + ->as($reference); |
|
| 52 | 52 | |
| 53 | 53 | $subselect = $this->applyQueryCallback($subselect); |
| 54 | 54 | |
@@ -56,7 +56,7 @@ |
||
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | $constructor = $this->class->addMethod('__construct') |
| 59 | - ->setBody('parent::__construct($attributes, $state);'); |
|
| 59 | + ->setBody('parent::__construct($attributes, $state);'); |
|
| 60 | 60 | $constructor->addParameter('attributes') |
| 61 | 61 | ->setType('array') |
| 62 | 62 | ->setDefaultValue([]); |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | $name = $this->relation->getName(); |
| 51 | 51 | $foreignMapper = $mapper->getOrm()->getMapper($this->relation->getForeignMapper()); |
| 52 | 52 | $type = $foreignMapper->getEntityNamespace() |
| 53 | - . '\\' . $foreignMapper->getEntityClass(); |
|
| 53 | + . '\\' . $foreignMapper->getEntityClass(); |
|
| 54 | 54 | |
| 55 | 55 | $class->getNamespace()->addUse($type, null, $type); |
| 56 | 56 | |
@@ -70,15 +70,15 @@ discard block |
||
| 70 | 70 | $setter = $class->addMethod(Str::methodName($name, 'set')); |
| 71 | 71 | $setter->setVisibility(ClassType::VISIBILITY_PUBLIC); |
| 72 | 72 | $setter->addParameter('value') |
| 73 | - ->setType($type) |
|
| 74 | - ->setNullable(true); |
|
| 73 | + ->setType($type) |
|
| 74 | + ->setNullable(true); |
|
| 75 | 75 | $setter->addBody('$this->set(\'' . $name . '\', $value);'); |
| 76 | 76 | |
| 77 | 77 | $getter = $class->addMethod(Str::methodName($name, 'get')); |
| 78 | 78 | $getter->setVisibility(ClassType::VISIBILITY_PUBLIC); |
| 79 | 79 | $getter->addBody('return $this->get(\'' . $name . '\');'); |
| 80 | 80 | $getter->setReturnType($type) |
| 81 | - ->setReturnNullable(true); |
|
| 81 | + ->setReturnNullable(true); |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | return $class; |