Blog Archives

Doctrine PHP Merge Function

If you’ve tried Doctrine PHP, you might get pretty frustrated when using the $Record::synchronizeWithArray() function. Why? $data = array(‘name’ => ‘jimbob’); $User->Doctrine::getTable(‘User’)->find(1); $User->synchronizeWithArray($data); $User->save(); If you try this code you will find that the synchronizeWithArray() function deletes everything except the ‘name’ field in the record. I think the name ‘synchronize’ is slightly confusing here, as [...]

A noob’s guide to PHP Doctrine

This week I am a newbie to PHP Doctrine. So I thought I’d share some of the experiences I’ve had with it, not so much in a coding sense but in a “this is the cool stuff you can do with it” sense. Doctrine is an ‘object relational mapper’ or ORM for short, letting you [...]