Service tests pass now.

This commit is contained in:
Greyscale 2020-09-28 20:01:07 +02:00
parent 6c6e0c183b
commit d687f96f18

View file

@ -564,6 +564,10 @@ abstract class AbstractTableGateway extends TableGateway
{
$select = $this->sql->select();
if($value instanceof \DateTime){
$value = $value->format("Y-m-d H:i:s");
}
$select->where([$field => $value]);
if ($orderBy) {
if ($orderBy instanceof Expression) {
@ -596,6 +600,10 @@ abstract class AbstractTableGateway extends TableGateway
{
$select = $this->sql->select();
if($value instanceof \DateTime){
$value = $value->format("Y-m-d H:i:s");
}
$select->where([$field => $value]);
if ($orderBy) {
if ($orderBy instanceof Expression) {
@ -627,6 +635,9 @@ abstract class AbstractTableGateway extends TableGateway
public function countByField(string $field, $value): int
{
$select = $this->sql->select();
if($value instanceof \DateTime){
$value = $value->format("Y-m-d H:i:s");
}
$select->where([$field => $value]);
$select->columns([
new Expression('COUNT(*) as count'),