Php Zend Framework复合主键更新

Php Zend Framework复合主键更新,php,zend-framework,zend-db,Php,Zend Framework,Zend Db,对于一个项目,我需要更新一行,其中PK包含两列 起初我以为我应该这样做,但它给了我错误。有人有办法吗 $data = array('foo','bar'); $where = $this->_getGateway()->getAdapter() ->quoteInto(array('customerId=?','date=?'), array($comment->customerId, $comment->date)); $t

对于一个项目,我需要更新一行,其中PK包含两列

起初我以为我应该这样做,但它给了我错误。有人有办法吗

$data = array('foo','bar');
$where = $this->_getGateway()->getAdapter()
                    ->quoteInto(array('customerId=?','date=?'), array($comment->customerId, $comment->date));
$this->_getGateway()->update($data, $where);
谢谢

明白了

$whereId = $this->_getGateway()->getAdapter()->quoteInto('customerId=?', $comment->customerId);
$whereDate = $this->_getGateway()->getAdapter()->quoteInto('date=?', $comment->date);
$this->_getGateway()->update($data, array($whereId, $whereDate));