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 'cakephp'
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);
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 [...]
So here I am, in Raleigh, NC – waiting for the CakePHP Workshop to start… We survived the rain so far, waiting to see if there is any flooding or whatnot.
Have met a few people here so far, all seem very friendly. Looking forward to seeing what happens and what we learn along the [...]