I have created a select query that functioning well. But now I need to change this to a like query. Can anyone tell me the correct way?
This is my select query structure ->
public function getSelectedHotel($id)
{
$selectedHotel = $this->tableGateway->select(['hotel_id' => $id]);
return $selectedHotel;
}
When I code like this it gives me this error.
Code ->
$hotelsByYear = $this->tableGateway->select()->where('date_added like ?',$year.'%');
Error ->
Fatal error: Uncaught Error: Call to undefined method Zend\Db\ResultSet\ResultSet::where() in