News Feed
Jobs Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Chris Hartjes' Blog:
The Devil's In The Details (or, Handling Sequences in Postgres in CakePHP)
February 04, 2008 @ 08:47:00

Chris Hartjes has shared his experiences in dealing with the combination of Postgres and CakePHP and convincing it to work with sequences in your tables.

I had been struggling with some weirdness that CakePHP has been displaying while trying to add some new features to the baseball league website, where Cake + PHP 4.4 + Postgres were deciding to just be sulky and not work together well.

Lucky for me, it turns out that the solution (for now) to the problem was to simply add the name of the sequence for that table as a variable to the model definition.

He includes the code for the Model that creates the connections between hos tables (belongsTo) and creates a sequence global to the class - note the naming convention.

0 comments voice your opinion now!
sequence postgres database cakephp framework example


blog comments powered by Disqus

Similar Posts

TheWorkAround.com: Determining, what makes a good framework?

Community News: Too Many Frameworks? (Andrei Zmievski and Clay Loveless)

PHPImpact Blog: From Swift Mailer to Zend_Mail

Chris Hartjes' Blog: 10 Days Later - Early Impressions of CakePHP vs. CodeIgniter

Derek Allard's Blog: 5 Things You May Not Know About CodeIgniter


Community Events











Don't see your event here?
Let us know!


release unittest facebook application composer introduction opinion performance code language hhvm hack install symfony2 package framework overview component podcast security

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework