Skip to content

Instantly share code, notes, and snippets.

@taleeb35
Created September 15, 2014 05:30
Show Gist options
  • Save taleeb35/42f3628f96d72bfe2d7d to your computer and use it in GitHub Desktop.
Save taleeb35/42f3628f96d72bfe2d7d to your computer and use it in GitHub Desktop.
<?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