MCPcopy Create free account
hub / github.com/denho/faved / createUser

Method createUser

models/Repository.php:93–107  ·  view source on GitHub ↗
(string $username, string $password_hash)

Source from the content-addressed store, hash-verified

91 }
92
93 public function createUser(string $username, string $password_hash)
94 {
95 $stmt = $this->pdo->prepare(
96 'INSERT INTO users (username, password_hash, created_at, updated_at)
97 VALUES (:username, :password_hash, :created_at, :updated_at)'
98 );
99 $date = date('Y-m-d H:i:s');
100 $stmt->execute([
101 ':username' => $username,
102 ':password_hash' => $password_hash,
103 ':created_at' => $date,
104 ':updated_at' => $date,
105 ]);
106 return $this->pdo->lastInsertId();
107 }
108
109 public function deleteUser(int $user_id)
110 {

Callers 2

__invokeMethod · 0.80
onSubmitFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected