Skip to content

Commit 09f6de3

Browse files
committed
fix: patch up user model
1 parent c796ecc commit 09f6de3

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

src/Auth/Model.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
namespace Leaf\Auth;
44

5+
use PDO;
6+
use PDOStatement;
7+
58
/**
69
* Auth User Model
710
* ----
@@ -44,9 +47,9 @@ public function __construct($data)
4447
*
4548
* @param array $data Data to be inserted
4649
*
47-
* @return bool
50+
* @return PDOStatement|null
4851
*/
49-
public function create(array $data): bool
52+
public function create(array $data): ?PDOStatement
5053
{
5154
$data['user_id'] = $this->user->id();
5255

@@ -56,7 +59,7 @@ public function create(array $data): bool
5659
$data['updated_at'] = $now;
5760
}
5861

59-
return $this->db->table($this->table)->insert($data)->execute();
62+
return $this->db->insert($this->table)->params($data)->execute();
6063
}
6164

6265
/**
@@ -102,9 +105,9 @@ public function table($columns = '*'): \Leaf\Db
102105
/**
103106
* Save a model resource
104107
*
105-
* @return bool
108+
* @return PDOStatement|null
106109
*/
107-
public function save(): bool
110+
public function save(): ?PDOStatement
108111
{
109112
$success = $this->create($this->dataToSave);
110113

0 commit comments

Comments
 (0)