Обновление составного первичного ключа Zend Framework

Для проекта мне нужно обновить строку, в которой PK содержит два столбца.

Сначала я думал, что должен сделать это так, но это выдает мне ошибки. Кто-нибудь с решением?

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

Спасибо


person baklap    schedule 30.08.2010    source источник


Ответы (1)


Понятно!

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