Thread: PHP Refugees
View Single Post
Old 09-10-2012, 08:32 PM  
edgeprod
Permanently Gone
 
Industry Role:
Join Date: Mar 2004
Posts: 10,019
My final (git commit'd) query:

Code:
$this->set('models', $this->Vehicle->find('all', array('conditions' => array('make' => $value),
                                                       'fields' => array('DISTINCT (model)'),
                                                 'order' => array('model' => 'ASC'))));
Ready to be loop'd into the iteration now, without having to have spaghetti PHP running around. Nothing to document in the code now, either, because the query is clear and when I reference it, it's just:

Code:
$models[$i]['Vehicle']['model'];
The need to "document" the method in the controller or its use in the view is now null, and should be non-documented. Its usage is now obvious.

Last edited by edgeprod; 09-10-2012 at 08:36 PM.. Reason: grammar :)
edgeprod is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote