/** * Delete this role * * @param void * @return boolean */ function delete() { if ($this->getUsersCount() > 0) { return new Error('Role cannot be deleted as long as there are users having it'); } // if return parent::delete(); }