Get a single row
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
This commit is contained in:
parent
a5ddd65c10
commit
0a2b57c93f
|
@ -44,10 +44,8 @@ class AccessTokenMapper extends Mapper {
|
|||
->from($this->tableName)
|
||||
->where($qb->expr()->eq('hashed_code', $qb->createNamedParameter(hash('sha512', $code))));
|
||||
$result = $qb->execute();
|
||||
$rows = $result->fetchAll();
|
||||
$row = $result->fetchAll();
|
||||
$result->closeCursor();
|
||||
return array_map(function ($row) {
|
||||
return AccessToken::fromRow($row);
|
||||
}, $rows);
|
||||
return AccessToken::fromRow($row);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,11 +44,9 @@ class ClientMapper extends Mapper {
|
|||
->from($this->tableName)
|
||||
->where($qb->expr()->eq('client_identifier', $qb->createNamedParameter($clientIdentifier)));
|
||||
$result = $qb->execute();
|
||||
$rows = $result->fetchAll();
|
||||
$row = $result->fetch();
|
||||
$result->closeCursor();
|
||||
return array_map(function ($row) {
|
||||
return Client::fromRow($row);
|
||||
}, $rows);
|
||||
return Client::fromRow($row);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue