zen of coding

Notes on CakePHP HABTM (Part 1, the basics)

Part 1. The basics HABTM seems to give a lot of people trouble, so I wanted to cover a few points that may or may not be in the manual. And I will assume here that you have basic understanding or some knowledge of HABTM, otherwise you should really go[…]

Read More »

What can we learn from CakePHP tests?

Update: Currently the API for test cases searches is down (but coming back soon). Remember, that you still have the test cases in the core of cake, so you can and should utilize them all the time ;) (If anyone wishes to volunteer their time to help out to bring[…]

Read More »

BETWEEN AND SQL syntax in CakePHP

This is how you’d write a BETWEEN… AND… SQL query in a cake-like way. The example should be pretty much self explanatory: $this->Post->find(‘all’, array(‘conditions’=>array(‘Post.id BETWEEN ? AND ?’ => array(1, 10)))); Note, that CakePHP will quote the numeric values depending on the field type in your DB.

Read More »
%d bloggers like this: