[10-Jul-2017 05:11:34 America/Denver] PHP Catchable fatal error: Argument 1 passed to Zend\Db\Sql\Update::set() must be of the type array, object given, called in /home2/flywing1/vendor/zendframework/zend-db/src/TableGateway/AbstractTableGateway.php on line 336 and defined in /home2/flywing1/vendor/zendframework/zend-db/src/Sql/Update.php on line 93
我的输出打印:158123 它给了我在set()函数中传递数组,我已经作为参数传递。我也尝试将对象转换为数组((arrya)$ objetc)但它对我不起作用。
myLongPullingFunc(){
this.http.get(longPullingURL)
.subscribe(res=>{
if(sholdFetchData){
useFetchedData(res);
this.myLongPullingFunc();
}else
doSomethingElse()
})
}
答案 0 :(得分:2)
试试吧, 我遇到了同样的问题,我尝试过这个问题,并且它有效。
$rowset = $projectTable->update(array('statement_no' => '01010'), $where);
答案 1 :(得分:2)
您可以通过实施Zend\Db\Sql\Update
对象来实现。您可以使用TableGateway
创建该对象。您应该能够在模型中执行以下操作
public function update($set, $where)
{
// Here is the catch
$update = $this->tableGateway->getSql()->update();
$update->set($set);
$update->where($where);
// Execute the query
return $this->tableGateway->updateWith($update);
}