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)
|
->from($this->tableName)
|
||||||
->where($qb->expr()->eq('hashed_code', $qb->createNamedParameter(hash('sha512', $code))));
|
->where($qb->expr()->eq('hashed_code', $qb->createNamedParameter(hash('sha512', $code))));
|
||||||
$result = $qb->execute();
|
$result = $qb->execute();
|
||||||
$rows = $result->fetchAll();
|
$row = $result->fetchAll();
|
||||||
$result->closeCursor();
|
$result->closeCursor();
|
||||||
return array_map(function ($row) {
|
|
||||||
return AccessToken::fromRow($row);
|
return AccessToken::fromRow($row);
|
||||||
}, $rows);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,11 +44,9 @@ class ClientMapper extends Mapper {
|
||||||
->from($this->tableName)
|
->from($this->tableName)
|
||||||
->where($qb->expr()->eq('client_identifier', $qb->createNamedParameter($clientIdentifier)));
|
->where($qb->expr()->eq('client_identifier', $qb->createNamedParameter($clientIdentifier)));
|
||||||
$result = $qb->execute();
|
$result = $qb->execute();
|
||||||
$rows = $result->fetchAll();
|
$row = $result->fetch();
|
||||||
$result->closeCursor();
|
$result->closeCursor();
|
||||||
return array_map(function ($row) {
|
|
||||||
return Client::fromRow($row);
|
return Client::fromRow($row);
|
||||||
}, $rows);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue