Advertisement
Guest User

Myaste

a guest
Apr 18th, 2014
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.77 KB | None | 0 0
  1. Armoire:
  2.  
  3. <?php
  4. class Armoire extends AppModel {
  5.    
  6.    
  7.     public $hasMany = array(
  8.         'Etage' => array(
  9.             'className' => 'Etage'
  10.            
  11.         )
  12.     );
  13.    
  14.    
  15. }
  16.  
  17. ?>
  18.  
  19. Etage :
  20.  
  21. <?php
  22. class Etage extends AppModel {
  23.     public $belongsTo = array(
  24.         'Armoire' => array(
  25.             'className' => 'Armoire',
  26.             'foreignKey' => 'armoire_id'
  27.         )
  28.     );
  29.      
  30.     public $hasMany = array(
  31.         'Livre' => array(
  32.             'className' => 'Livre'
  33.            
  34.         )
  35.     );
  36.    
  37.    
  38. }
  39.  
  40. ?>
  41.  
  42. Livre:
  43.  
  44. <?php
  45. class Livre extends AppModel {
  46.    
  47.     public $belongsTo = array(
  48.         'Etage' => array(
  49.             'className' => 'Etage',
  50.             'foreignKey' => 'etage_id'
  51.         )
  52.     );
  53.      
  54.    
  55.    
  56.    
  57. }
  58.  
  59. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement