Practice::beforeDelete PHP Method

beforeDelete() protected method

Delete commissioning body assignments for referential integrity Note if patients are assigned to the practice, there will still be a referential integrity error and the delete will fail.
protected beforeDelete ( ) : boolean
return boolean
    protected function beforeDelete()
    {
        if (parent::beforeDelete()) {
            foreach ($this->commissioningbodyassigments as $cba) {
                $cba->delete();
            }
            return true;
        }
    }