ContactsTable.php モジュールと次のような関数があります。
public function getContactsByLastName($last_name){
$rowset = $this->tableGateway->select(array('last_name' => $last_name));
$row = $rowset->current();
if (!$row) {
throw new \Exception("Could not find row record");
}
return $row;
}
これは問題ありませんが、1 行しか返されません。問題は私のデータベースにあり、同じ姓の複数のレコードがあるので、私の質問は次のとおりです。データのセットを返すにはどうすればよいですか?
私はこれを試しました:
$where = new Where();
$where->like('last_name', $last_name);
$resultSet = $this->tableGateway->select($where);
return $resultSet;
しかし、うまくいきません。