array('className' => 'Country', 'foreignKey' => 'country_id', 'conditions' => '', 'fields' => '', 'order' => '' ), 'Currency' => array('className' => 'Currency', 'foreignKey' => 'currency_id', 'conditions' => '', 'fields' => '', 'order' => '' ) ); var $hasMany = array( 'Enquiry' => array('className' => 'Enquiry', 'foreignKey' => 'principle_id', 'dependent' => false, 'conditions' => '', 'fields' => '', 'order' => '', 'limit' => '', 'offset' => '', 'exclusive' => '', 'finderQuery' => '', 'counterQuery' => '' ), 'Product' => array('className' => 'Product', 'foreignKey' => 'principle_id', 'dependent' => false, 'conditions' => '', 'fields' => '', 'order' => '', 'limit' => '', 'offset' => '', 'exclusive' => '', 'finderQuery' => '', 'counterQuery' => '' ), 'PrincipleAddress' => array('className' => 'PrincipleAddress', 'foreignKey' => 'principle_id' ), 'PrincipleContact' => array('className' => 'Users', 'foreignKey' => 'principle_id' ), ); function getCityCountryList() { $principles = $this->find('all', array('recursive'=>1)); $search = array('{company}','{city}','{country}'); $phrase = "Ex Works Incoterms 2010 ({company}, {city}, {country})"; $list = array(); foreach($principles as $principle) { $replace = array($principle['Principle']['name'], $principle['Principle']['city'], $principle['Country']['name']); $newPhrase = str_replace($search, $replace, $phrase); $list[$newPhrase] = $newPhrase; } return $list; } } ?>