I have the following code inside a class that extends Zend_Db_Table_Abstract
:
public function fetchByFriends($id) {
/*
* SELECT * FROM list
* INNER JOIN friendship ON
* list.user_id = friendship.friend_id
* WHERE friendship.user_id = ?
*/
$select = $this->select()
->from("list")
->join("friendship", "list.user_id = friendship.friend_id")
->where("friendship.user_id = ?", $id);
$select->setIntegrityCheck(false); // allows joins within a DbTable
$stmt = $select->query();
return $this->fetchAll($stmt);
}
While the query works fine the data returned is of an array. Is there some way to refactor this so that fetchAll
returns it as a Zend_Db_Table_Rowset
, rather than an array?