12.26 php saved
jbourassa
Tags add more
 
Note
jbourassa did not leave a note
  1. //Model
  2. class Evaluation extends AppModel {
  3.  
  4.     var $name = 'Evaluation';
  5.     var $displayField = 'desc';
  6.     var $actsAs = array('MultipleDisplayFields' => array(
  7.         'fields' => array('Utilisateur.nom', 'Utilisateur.prenom', 'Utilisateur.matricule'),
  8.         'pattern' => '%s, %s (%s)'
  9.    
  10.     ));
  11.     //The Associations below have been created with all possible keys, those that are not needed can be removed
  12.     var $belongsTo = array(
  13.             'Utilisateur' => array('className' => 'Utilisateur',
  14.                                 'foreignKey' => 'utilisateur_id',
  15.                                 'conditions' => '',
  16.                                 'fields' => '',
  17.                                 'order' => ''
  18.             )
  19.     );
  20. //and more associations
  21.  
  22.  
  23. //Controller
  24. $this->set('evaluation', $this->Autorisation->Evaluation->find('list'));
  25.  
  26.  
  27. //Resulting sql :
  28.  
  29. /* SELECT `Evaluation`.`id`, `Utilisateur`.`nom`, `Utilisateur`.`prenom`, `Utilisateur`.`matricule` FROM `evaluations` AS `Evaluation`   WHERE 1 = 1 */
  30.  
  31.  
Parsed in 0.038 seconds, using GeSHi 1.0.7.14

Modify this Paste