Skip to content

Instantly share code, notes, and snippets.

@thecopy
Created May 7, 2014 14:30
Show Gist options
  • Save thecopy/94337b7b7856ce4dec68 to your computer and use it in GitHub Desktop.
Save thecopy/94337b7b7856ce4dec68 to your computer and use it in GitHub Desktop.
function onBeforeWrite(){
parent::onBeforeWrite();
if(empty($this->CountryID)){
$this->CountryID = defined('DEFAULT_COUNTRY') ? Country::getCountryID(DEFAULT_COUNTRY) : 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment