Service tests pass now.
This commit is contained in:
parent
6c6e0c183b
commit
d687f96f18
1 changed files with 11 additions and 0 deletions
|
|
@ -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'),
|
||||
|
|
|
|||
Loading…
Reference in a new issue