Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Allow searching on fetchall #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/TableGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function __construct($table, AdapterInterface $adapter, $features = null)
{
$hydratorClass = class_exists(ObjectPropertyHydrator::class)
? ObjectPropertyHydrator::class
: ObjectPropertyHydrator::class;
: ObjectProperty::class;
$resultSet = new HydratingResultSet(new $hydratorClass(), new Entity());
return parent::__construct($table, $adapter, $features, $resultSet);
}
Expand Down
5 changes: 3 additions & 2 deletions src/TableGatewayMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,12 @@ public function fetch($id)
}

/**
* @param array $params
* @return Collection
*/
public function fetchAll()
public function fetchAll($params = null)
{
return new Collection(new DbTableGateway($this->table, null, ['timestamp' => 'DESC']));
return new Collection(new DbTableGateway($this->table, $params, ['timestamp' => 'DESC']));
}

/**
Expand Down