function delete()
 {
     $workspace_billings = WorkspaceBillings::find(array('conditions' => 'billing_id = ' . $this->getId()));
     if ($workspace_billings) {
         foreach ($workspace_billings as $billing) {
             $billing->delete();
         }
     }
     $users = $this->getCategoryUsers();
     if ($users) {
         foreach ($users as $user) {
             $user->setDefaultBillingId(0);
             $user->save();
         }
     }
     parent::delete();
 }