Making the public key a property that we store for projects, and displaying it for later use.

This commit is contained in:
Dan Cryer 2014-04-30 14:14:23 +01:00
commit 195d85a82c
9 changed files with 816 additions and 655 deletions

View file

@ -16,11 +16,9 @@ use PHPCI\Model\User;
*/
class UserStoreBase extends Store
{
protected $tableName = 'user';
protected $modelName = '\PHPCI\Model\User';
protected $primaryKey = 'id';
protected $tableName = 'user';
protected $modelName = '\PHPCI\Model\User';
protected $primaryKey = 'id';
public function getByPrimaryKey($value, $useConnection = 'read')
{
@ -34,7 +32,7 @@ class UserStoreBase extends Store
}
$query = 'SELECT * FROM `user` WHERE `id` = :id LIMIT 1';
$stmt = Database::getConnection($useConnection)->prepare($query);
$stmt = Database::getConnection($useConnection)->prepare($query);
$stmt->bindValue(':id', $value);
if ($stmt->execute()) {
@ -42,6 +40,7 @@ class UserStoreBase extends Store
return new User($data);
}
}
return null;
}
@ -52,7 +51,7 @@ class UserStoreBase extends Store
}
$query = 'SELECT * FROM `user` WHERE `email` = :email LIMIT 1';
$stmt = Database::getConnection($useConnection)->prepare($query);
$stmt = Database::getConnection($useConnection)->prepare($query);
$stmt->bindValue(':email', $value);
if ($stmt->execute()) {
@ -60,6 +59,7 @@ class UserStoreBase extends Store
return new User($data);
}
}
return null;
}
}