zen of coding

Incrementing a field in CakePHP

Let’s say you have an application, where users can place votes for their favorite products and you’d like to increment the current number of votes by one. It’s very easy by using updateAll: $this->Product->updateAll( array(   ‘Product.vote’ => ‘Product.vote+1′ ), array(’Product.id’ => 40)); You may want to restrict Product model[…]

Read More »

CakePHP cookbook 1.2 (as of 05/21/2008) in PDF format

Update: 6/09/2008 Unforunatelly I cannot have this PDF file here anymore, since it is a violation of the license. The good news is that PDF export will soon become a part of the official cookbook site, so stay tuned…

Read More »
%d bloggers like this: