public function delete()
 {
     $table_name_prefix = 'user_' . $this->getId();
     // delete all his wechat_account first, as the deletion can cast onto global accounts
     foreach (UserWechatAccount::findAll($this->getId()) as $account) {
         $account->delete();
     }
     // delete user tables
     parent::dropTableByName($table_name_prefix . '_read');
     parent::dropTableByName($table_name_prefix . '_account');
     parent::dropTableByName($table_name_prefix . '_category');
     return parent::delete();
 }
Exemple #2
0
<?php

require_permission('manager feeds');
$html = new HTML();
$html->renderOut('site/html_header', array('title' => '公众号 :: ' . $settings['sitename'], 'body_class' => 'accounts'));
$html->renderOut('site/header/blank');
$html->renderOut('site/nav/main');
$html->renderOut('site/accounts', array('accounts' => UserWechatAccount::findAll()));
$html->renderOut('site/footer');
$html->renderOut('site/html_footer');