public function onUnregisterUser(OW_Event $event) { $params = $event->getParams(); if (empty($params['deleteContent'])) { return; } OW::getCacheManager()->clean(array(PostDao::CACHE_TAG_POST_COUNT)); $userId = $params['userId']; $count = (int) $this->service->countUserPost($userId); if ($count == 0) { return; } $list = $this->service->findUserPostList($userId, 0, $count); foreach ($list as $post) { $this->service->delete($post); } }