我想從我的數據庫中獲得一些行,其中一個字段有一個特定的值。 我試過這段代碼:Zend Framework 2得到多個行
public function getJewelrybyCollection($collection)
{
$rowset = $this->tableGateway->select(array('collection' => $collection));
$row = $rowset->current();
if (!$row) {
throw new \Exception("Could not find collection $collection");
}
return $row;
}
這是工作,但僅檢索一行,由於$row = $rowset->current();
我試圖返回$rowset
變種,沒有好的結果。
我是新來ZF2
謝謝
嘗試在RowSet – Abadis 2013-04-11 06:43:16