The CakePHP book page on the new Hash class, the replacement for Set, is not exactly extensive. There’s even an error: the arguments for Hash::extract are $data, $path, but the example given uses $path, $data (the former is correct). One aspect of Hash that the book is particularly quiet on is how to use path conditions with methods such as [...]
THIS CONTENT IS OUT OF DATE! IF YOU’RE USING CAKE 2, YOU SHOULDN’T READ THIS. Here’s a quickie – a Cipher behavior for CakePHP to handle two-way encryption of sensitive data. If you want to store, say, credit card information, you’ll need a way to retrieve it later; Cake’s built-in security hashing is one-way, meaning that once it’s encrypted it [...]
THIS CONTENT IS OUT OF DATE! IF YOU’RE USING CAKE 2, YOU SHOULDN’T READ THIS. Major update January 22/10: much of the content of this article has been updated to reflect the changes to the datasource, the latest version of which you can download on Github. Just out of the oven – a Zend_Search_Lucene datasource for CakePHP (built with 1.2 [...]
THIS CONTENT IS OUT OF DATE! IF YOU’RE USING CAKE 2, YOU SHOULDN’T READ THIS. There are two main methods for finding random records with PHP (and in this case CakePHP) and MySQL: Use a SELECT query with ORDER BY RAND() and LIMIT x (where x is the number of results you want). Get a list of the primary keys [...]
