Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/270.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php ZF2数据库表未返回任何实例_Php_Exception_Zend Framework2 - Fatal编程技术网

Php ZF2数据库表未返回任何实例

Php ZF2数据库表未返回任何实例,php,exception,zend-framework2,Php,Exception,Zend Framework2,我在ZF2中的数据库模型遇到了一个问题,我必须在应用程序中接触一些东西,因为我确信它以前工作过 不知道是否有人可以通过我收到的以下错误消息读出问题 如果需要更多错误信息,我可以用堆栈更新此问题:) 例外说明了你需要知道的大部分 File: /home/xxxx/domains/xxxx/vendor/zendframework/zendframework/library/Zend/Db/TableGateway/AbstractTableGateway.php:105 Message:

我在ZF2中的数据库模型遇到了一个问题,我必须在应用程序中接触一些东西,因为我确信它以前工作过

不知道是否有人可以通过我收到的以下错误消息读出问题

如果需要更多错误信息,我可以用堆栈更新此问题:)


例外说明了你需要知道的大部分

File:
 /home/xxxx/domains/xxxx/vendor/zendframework/zendframework/library/Zend/Db/TableGateway/AbstractTableGateway.php:105

 Message:
 This table object does not have a valid table set.
我去了
Zend/Db/TableGateway/AbstractTableGateway.php:105
,下面的代码就在那里

if (!is_string($this->table) && !$this->table instanceof TableIdentifier && !is_array($this->table)) {
    throw new Exception\RuntimeException('This table object does not have a valid table set.');
}
所以你的例外意味着。
$this->table
不是
字符串
数组
或Zend\Db\Sql\TableIdentifier的
实例

所以你可能没有摆好桌子

现在我从未使用过
AbstractTableGateway
,因此不确定如何在正确的上下文中使用它。但是我看不到一个
可设置的
,或者类似于
设置选项的东西

所以,除非你能展示你的TableGateWay的实现,这是我所知的


注意,我看了zf2.3.3

完美!是的,我在写$this->\u表而不是$this->table时犯了错误。。。。多谢各位
if (!is_string($this->table) && !$this->table instanceof TableIdentifier && !is_array($this->table)) {
    throw new Exception\RuntimeException('This table object does not have a valid table set.');
}