public function beforeSave()
{
switch ($this->type) {
case 'site':
$this->firm_id = null;
$this->subspecialty = null;
break;
case 'subspecialty':
$this->firm_id = null;
$this->site_id = null;
break;
case 'firm':
$this->subspecialty_id = null;
$this->site_id = null;
break;
}
return parent::beforeSave();
}