From 30513ab7c63ecab46106d3480be9fe8a645b7fd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henry=20Stivens=20Adarme=20Mu=C3=B1oz?= Date: Sun, 30 May 2021 21:29:21 -0500 Subject: [PATCH 1/4] Removed commented out code --- LiteRecord.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LiteRecord.php b/LiteRecord.php index c521072..30f0a99 100644 --- a/LiteRecord.php +++ b/LiteRecord.php @@ -105,10 +105,10 @@ public function update(array $data = []): bool if ($this->callback('_beforeUpdate') === \false) { return \false; } - //$this->hasPK(); + $values = []; $sql = QueryGenerator::update($this, $values); - //var_dump($values);var_dump($sql);die; + if ( ! self::prepare($sql)->execute($values)) { return \false; } From 3b06eda0f471a45af737106987ddfbfddbdff553 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henry=20Stivens=20Adarme=20Mu=C3=B1oz?= Date: Sun, 30 May 2021 21:30:01 -0500 Subject: [PATCH 2/4] Calling it as non static method --- LiteRecord.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LiteRecord.php b/LiteRecord.php index 30f0a99..df0e7a3 100644 --- a/LiteRecord.php +++ b/LiteRecord.php @@ -152,7 +152,7 @@ public function save(array $data = []): bool */ protected function saveMethod(): string { - return static::hasPK() ? 'create' : 'update'; + return $this->hasPK() ? 'create' : 'update'; } /** From 6ea9bd85e14e90459af67108a5d0ace6b5c297da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henry=20Stivens=20Adarme=20Mu=C3=B1oz?= Date: Sun, 30 May 2021 21:30:46 -0500 Subject: [PATCH 3/4] Fixed getting the save method name --- LiteRecord.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LiteRecord.php b/LiteRecord.php index df0e7a3..875c111 100644 --- a/LiteRecord.php +++ b/LiteRecord.php @@ -152,7 +152,7 @@ public function save(array $data = []): bool */ protected function saveMethod(): string { - return $this->hasPK() ? 'create' : 'update'; + return $this->hasPK() ? 'update' : 'create'; } /** From 2cb39b3078062296f4f517ce8f5dcc1a7b4170eb Mon Sep 17 00:00:00 2001 From: Joanhey Date: Mon, 31 May 2021 10:45:02 +0200 Subject: [PATCH 4/4] 0.5.5 --- BaseRecord.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BaseRecord.php b/BaseRecord.php index 310f980..13385c2 100644 --- a/BaseRecord.php +++ b/BaseRecord.php @@ -29,7 +29,7 @@ abstract class BaseRecord { - public const VERSION = '0.5.4'; + public const VERSION = '0.5.5'; /** * Database por defecto usa default.