我只是 ZF2 的新手并使用以下功能。
public function fetchAll()
{
$resultSet = $this->tableGateway->select();
return $resultSet;
}
当我使用 print_r($resultSet) 它在结果中显示以下内容而不是表中的所有行,这是我所期待的。你能说出为什么它没有显示所有行吗?
Zend\Db\ResultSet\ResultSet Object
(
[allowedReturnTypes:protected] => Array
(
[0] => arrayobject
[1] => array
)
[arrayObjectPrototype:protected] => Users\Model\User Object
(
[id] =>
[name] =>
[email] =>
[password] =>
)
[returnType:protected] => arrayobject
[buffer:protected] =>
[count:protected] => 3
[dataSource:protected] => Zend\Db\Adapter\Driver\Pdo\Result Object
(
[statementMode:protected] => forward
[resource:protected] => PDOStatement Object
(
[queryString] => SELECT `user`.* FROM `user`
)
[options:protected] =>
[currentComplete:protected] =>
[currentData:protected] =>
[position:protected] => -1
[generatedValue:protected] => 0enter code here
[rowCount:protected] => 3
)
[fieldCount:protected] => 4
[position:protected] => 0
)