If knowledge is power, then sharing knowledge is ultimate powertrip
Latest Updates
You are here: Home >> 2011 >> May

Monthly Archives: May 2011

Self join in CakePHP

I tried to explain how to do a self join in CakePHP I use this in my Gallery Model: var $hasMany = array( ‘Galleries’ => array( ‘className’ => ‘Gallery’, ‘order’ => ‘Galleries.ord ASC’, ‘foreignKey’ => ‘parent_id’)); var $belongsTo = array( ‘Galleries’ => array( ‘className’ => ‘Gallery’, ‘order’ => ‘Galleries.ord ASC’, ‘foreignKey’ => ‘parent_id’)); First, note the ‘Galleries’ (you change that ... Read More »

Scroll To Top