Created
September 15, 2014 05:30
-
-
Save taleeb35/42f3628f96d72bfe2d7d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
App::uses('AppModel', 'Model'); | |
/** | |
* Department Model | |
* | |
* @property Project $Project | |
*/ | |
class Country extends AppModel { | |
public $hasMany = array( | |
'State' => array( | |
'className' => 'State', | |
'foreignKey' => 'country_id', | |
'dependent' => false, | |
) | |
); | |
} | |
<?php | |
App::uses('AppModel', 'Model'); | |
/** | |
* Department Model | |
* | |
* @property Project $Project | |
*/ | |
class State extends AppModel { | |
public $belongsTo = array( | |
'Country' => array( | |
'className' => 'Country', | |
'foreignKey' => 'country_id', | |
'conditions' => '', | |
'fields' => '', | |
'order' => '' | |
) | |
); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment