if you add a primary key which would turn an “insert” into an “update” within beforeSave() you’ll need to set $this->__exists = true;… the call to $this->exists(); happens in model.php before the callback to beforeSave().
Category Archive for 'php'
I’m a bit proud of myself on this one… I setup a simple, but clean and configurable, MySQL Master/Slave Replication Monitoring PHP Script:
It’s Open Source and free, I welcome comments, suggestions, and questions.
I think this will be quite useful for anyone who is setting up a pair of MySQL servers as master/slave and want [...]
I’ve been working with CakePHP for a few years now and am very happy with it. I’ve been working with the 1.2 version for a few months (since it went stable) and playing with the Auth and ACL core components.
I’ve decided that ACL is too complicated for most setups, and Auth is fine, but not [...]
Posted in cakephp on Nov 30th, 2009
I noticed that the data for my saves were not populating with the current date/time as they should, when calling the model->create() function, without a parameter, and then the model->save() function.
$data = $this->ModelName->save($dataWithoutCreatedModifiedUpdated);
So I’ve just fought a battle w/ SVN merge and thought I’d post the solution in case others might find it…
Our stable code is in trunk svn://svn.domain.tld/repository/trunk
I’ve got a branch of trunk svn://svn.domain.tld/repository/branches/dev
Changes have been made to my branch and changes have been made to trunk, since I branched.
I’m ready to merge my branch back [...]
A very funny post for the programming nerds out there:
If programming languages were religions…
By amz – Monday, December 15, 2008 at 14:52
PHP would be Cafeteria Christianity – Fights with Java for the web market. It draws a few concepts from C and Java, but only those that it really likes. Maybe it’s not as coherent [...]
I just created a handy little script to create todos in basecamp for unresovled tickets in mantis.
You can see the open sourced code/project: http://code.google.com/p/mantis2basecamp-todo/.
This is something we found useful, if you use both tools, you might find it useful as well.
We had the very good fortune of attending the first CakePHP workshop, in Raleigh, NC this weekend. Four of the core developers of the project where there, including the project manger and the lead developer; along with one of the guys behind jquery-UI. The non-presenters ranged from people who had never used CakePHP to people who had been using [...]