@@ -21,10 +21,10 @@ |
||
| 21 | 21 | |
| 22 | 22 | $update = new \Sirius\Sql\Update($this->mapper->getWriteConnection()); |
| 23 | 23 | $update->table($this->mapper->getTable()) |
| 24 | - ->columns([ |
|
| 25 | - $this->getOption('deleted_at_column') => $this->now |
|
| 26 | - ]) |
|
| 27 | - ->where('id', $entityId); |
|
| 24 | + ->columns([ |
|
| 25 | + $this->getOption('deleted_at_column') => $this->now |
|
| 26 | + ]) |
|
| 27 | + ->where('id', $entityId); |
|
| 28 | 28 | $update->perform(); |
| 29 | 29 | } |
| 30 | 30 | |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | protected function execute() |
| 14 | 14 | { |
| 15 | 15 | $entityId = $this->entity->getPk(); |
| 16 | - if (! $entityId) { |
|
| 16 | + if (!$entityId) { |
|
| 17 | 17 | return; |
| 18 | 18 | } |
| 19 | 19 | |
@@ -83,7 +83,7 @@ |
||
| 83 | 83 | |
| 84 | 84 | $insert = new \Sirius\Sql\Insert($conn); |
| 85 | 85 | $insert->into($throughTable) |
| 86 | - ->columns($insertColumns) |
|
| 87 | - ->perform(); |
|
| 86 | + ->columns($insertColumns) |
|
| 87 | + ->perform(); |
|
| 88 | 88 | } |
| 89 | 89 | } |
@@ -51,10 +51,10 @@ |
||
| 51 | 51 | $conn = $this->relation->getNativeMapper()->getWriteConnection(); |
| 52 | 52 | $throughTable = (string)$this->relation->getOption(RelationOption::THROUGH_TABLE); |
| 53 | 53 | |
| 54 | - $throughNativeColumns = (array) $this->relation->getOption(RelationOption::THROUGH_NATIVE_COLUMN); |
|
| 55 | - $throughForeignColumns = (array) $this->relation->getOption(RelationOption::THROUGH_FOREIGN_COLUMN); |
|
| 56 | - $nativeKey = (array) $this->nativeEntity->getPk(); |
|
| 57 | - $foreignKey = (array) $this->foreignEntity->getPk(); |
|
| 54 | + $throughNativeColumns = (array)$this->relation->getOption(RelationOption::THROUGH_NATIVE_COLUMN); |
|
| 55 | + $throughForeignColumns = (array)$this->relation->getOption(RelationOption::THROUGH_FOREIGN_COLUMN); |
|
| 56 | + $nativeKey = (array)$this->nativeEntity->getPk(); |
|
| 57 | + $foreignKey = (array)$this->foreignEntity->getPk(); |
|
| 58 | 58 | |
| 59 | 59 | $delete = new \Sirius\Sql\Delete($conn); |
| 60 | 60 | $delete->from($throughTable); |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | public static function new(...$args) |
| 11 | 11 | { |
| 12 | 12 | if ($args[0] instanceof Connection) { |
| 13 | - return new ConnectionLocator(function () use ($args) { |
|
| 13 | + return new ConnectionLocator(function() use ($args) { |
|
| 14 | 14 | return $args[0]; |
| 15 | 15 | }); |
| 16 | 16 | } |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | if (strpos($key, $separator)) { |
| 27 | 27 | $parents = static::getParents($key, $separator); |
| 28 | 28 | foreach ($parents as $parent) { |
| 29 | - if (! isset($arr[$parent])) { |
|
| 29 | + if (!isset($arr[$parent])) { |
|
| 30 | 30 | $arr[$parent] = null; |
| 31 | 31 | } |
| 32 | 32 | } |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | public static function underscore($str) |
| 17 | 17 | { |
| 18 | - if (! isset(static::$cache['underscore'][$str])) { |
|
| 18 | + if (!isset(static::$cache['underscore'][$str])) { |
|
| 19 | 19 | $str = strtolower($str); |
| 20 | 20 | $str = preg_replace("/[^a-z0-9]+/", ' ', $str); |
| 21 | 21 | |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | public static function methodName($str, $verb) |
| 29 | 29 | { |
| 30 | 30 | $key = $verb . $str; |
| 31 | - if (! isset(static::$cache['methodName'][$key])) { |
|
| 31 | + if (!isset(static::$cache['methodName'][$key])) { |
|
| 32 | 32 | static::$cache['methodName'][$key] = strtolower($verb) . static::className($str); |
| 33 | 33 | } |
| 34 | 34 | |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | public static function variableName($str) |
| 39 | 39 | { |
| 40 | - if (! isset(static::$cache['variableName'][$str])) { |
|
| 40 | + if (!isset(static::$cache['variableName'][$str])) { |
|
| 41 | 41 | $class = static::className($str); |
| 42 | 42 | |
| 43 | 43 | static::$cache['variableName'][$str] = strtolower(substr($class, 0, 1)) . substr($class, 1); |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | public static function className($str) |
| 50 | 50 | { |
| 51 | - if (! isset(static::$cache['className'][$str])) { |
|
| 51 | + if (!isset(static::$cache['className'][$str])) { |
|
| 52 | 52 | $str = strtolower($str); |
| 53 | 53 | $str = preg_replace("/[^a-z0-9]+/", ' ', $str); |
| 54 | 54 | $str = ucwords($str); |
@@ -77,7 +77,7 @@ |
||
| 77 | 77 | /** @var ArrayCollection $changeCollection */ |
| 78 | 78 | $changeCollection = $this->changes[$t]; |
| 79 | 79 | if ($t == $type) { |
| 80 | - if (! $changeCollection->contains($element)) { |
|
| 80 | + if (!$changeCollection->contains($element)) { |
|
| 81 | 81 | $changeCollection->add($element); |
| 82 | 82 | } |
| 83 | 83 | } else { |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | public function setRelation($name, Relation $relation, $callback, $overwrite = false) |
| 47 | 47 | { |
| 48 | - if ($overwrite || ! isset($this->relations[$name])) { |
|
| 48 | + if ($overwrite || !isset($this->relations[$name])) { |
|
| 49 | 49 | $this->relations[$name] = $relation; |
| 50 | 50 | $this->relationCallbacks[$name] = $callback; |
| 51 | 51 | } |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | public function getRelationResults($name) |
| 65 | 65 | { |
| 66 | - if (! isset($this->relations[$name])) { |
|
| 66 | + if (!isset($this->relations[$name])) { |
|
| 67 | 67 | return null; |
| 68 | 68 | } |
| 69 | 69 | |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | } |
| 43 | 43 | } |
| 44 | 44 | if ($action instanceof Update && $this->updateColumn) { |
| 45 | - if (! empty($action->getEntity()->getChanges())) { |
|
| 45 | + if (!empty($action->getEntity()->getChanges())) { |
|
| 46 | 46 | $action->addColumns([$this->updateColumn => time()]); |
| 47 | 47 | } |
| 48 | 48 | } |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | public static function getInstance() |
| 18 | 18 | { |
| 19 | - if (! static::$instance) { |
|
| 19 | + if (!static::$instance) { |
|
| 20 | 20 | static::$instance = new static; |
| 21 | 21 | } |
| 22 | 22 | |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | protected function getQueryClass(Mapper $mapper) |
| 34 | 34 | { |
| 35 | 35 | $mapperClass = get_class($mapper); |
| 36 | - if (! isset($this->queryClasses[$mapperClass])) { |
|
| 36 | + if (!isset($this->queryClasses[$mapperClass])) { |
|
| 37 | 37 | $queryClass = $mapperClass . 'Query'; |
| 38 | 38 | if (class_exists($queryClass)) { |
| 39 | 39 | $this->queryClasses[$mapperClass] = $queryClass; |