Issues

ZF-229: Redefining update method also needs to specify the where clause

Issue Type: Docs: Problem Created: 2006-07-11T22:36:03.000+0000 Last Updated: 2008-12-19T13:45:20.000+0000 Status: Closed Fix version(s): Reporter: Justin Plock (jplock) Assignee: Bill Karwin (bkarwin) Tags: - Zend_Db

Related issues: Attachments:

Description

In section 6.4.10. Adding Domain Logic of the Zend_Db_Table documentation, the documentation describes how you can override the insert() and update() methods in a particular table class. However, the update method needs to also specify the where clause otherwise it will get lost and all rows will be updated.

public function update($data) { // add a timestamp if (empty($data['updated_on'])) { $data['updated_on'] = time(); } return parent::update($data); }

Needs to change to:

public function update($data, $where) { // add a timestamp if (empty($data['updated_on'])) { $data['updated_on'] = time(); } return parent::update($data, $where); }

Comments

Posted by Justin Plock (jplock) on 2006-07-13T08:29:06.000+0000

Duplicate of ZF-174

Posted by Wil Sinclair (wil) on 2008-12-19T13:45:20.000+0000

Bookkeeping. Closing old issues and assigning them to the person who ultimately resolved the issue.

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts