Articles tagged with "model"

Adding friendly URLs to The Cake Blog Tutorial

By Mariano Iglesias
On this tutorial we'll learn how to modify The Cake Blog Tutorial to allow friendly URLs when accessing posts.
[Read more]

AttributeBehavior - DRY and powerful

By taylor luk
Another piece taken inspiration from a somewhat similar AliasBehavior, but most of the time u to do more than aliasing. What about a simple callback mechanism to build aliases, virtual or derivative attributes the simple way, Results is pretty neat. :)
[Read more]

Rebuilding MySQL Tables based on Model Cache

By Jim Walker
By reading the title of this article you know something has gone horribly wrong. Which was the case earlier today when my development server crashed with our teams shared database on it. While we did have backups of most of the data a few of the tables and a couple smaller projects were not so lucky.
[Read more]

Quick Tip - Doing Ad-hoc Joins in Model::find()

By Nate
Herewith, a little-known query trick that allows you to do simple ad-hoc joins in your CakePHP finder queries. No binding or unbinding required.
[Read more]

Table Optimize

By Cees Jan Kiewiet
While developing a simple wiki bot with a queue table I noticed that sometimes the table kept it's old data as overhead. For that I searched through the bakery, manual and API but couldn't find anything about this. So this simple function was born.
[Read more]

StarSchema (OLAP) setup for reporting

By Martin Westin
When you need to gather statistics and reporting data from a large number of transactions (easily >1'000'000 rows) you need to transfer that data over to a reporting-friendly format to keep request times down. One popular database design for this is called a Star Schema. This is a simple re-usable StarSchema setup for CakePHP.

[Read more]

Ticket Model for CakePHP

By Darren Moore
This model will create a simple one-off ticket which can be used for user password resetting to activation and moderation.

With an activate account example you might send a url like http://domain.tld/users/activate/6d9c79a15255
[Read more]

Convenient Enable and Disable of Model cacheQueries

By Dennis S Hennen
Often we need to disable Cake's query caching for a single find statement or a sequence of related finds. This behavior provides a way to do that quickly.
[Read more]

Simple way to memcache (almost) all database queries

By Rafal Molotkiewicz
Most common way to access data is a database. Most common way to speed this up - Memcached.
As a quite young CakePHP developer I had a bit of headache "how to cache queries effectively?". Now I know the way, so I share. Feel free to disagree, upgrade and so on.
[Read more]