当前位置: 首页>>代码示例>>PHP>>正文


PHP Network::leave_all_networks方法代码示例

本文整理汇总了PHP中Network::leave_all_networks方法的典型用法代码示例。如果您正苦于以下问题:PHP Network::leave_all_networks方法的具体用法?PHP Network::leave_all_networks怎么用?PHP Network::leave_all_networks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Network的用法示例。


在下文中一共展示了Network::leave_all_networks方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: delete

 /**
  * Delete the user from the system
  *
  * User data is never 'hard deleted' from the database. Instead the 'is_active' flag is set to 1
  *
  */
 public static function delete($user_id, $true_delete = FALSE)
 {
     Logger::log("Enter: function User::delete");
     // check whether user is already deleted
     if ($true_delete) {
         $sql = 'SELECT * from {users} WHERE user_id=?';
         $data = array($user_id);
     } else {
         $sql = 'SELECT * from {users} WHERE user_id=? AND is_active = ?';
         $data = array($user_id, DELETED);
     }
     $res = Dal::query($sql, $data);
     if ($res->numRows() > 0 && !$true_delete) {
         Logger::log("Throwing exception USER_ALREADY_DELETED | message: Can not delete a deleted user");
         throw new PAException(USER_ALREADY_DELETED, "Can not delete a deleted user.");
     } else {
         if ($true_delete) {
             $sql = 'DELETE FROM {users} WHERE user_id = ?';
             $sql1 = 'DELETE FROM {user_profile_data} WHERE user_id = ?';
             $data = array($user_id);
             $res = Dal::query($sql, $data);
             $res = Dal::query($sql1, $data);
         } else {
             $sql = 'UPDATE {users} SET login_name = CONCAT(?, login_name), email = CONCAT(?, email), is_active = ? WHERE user_id = ?';
             $data = array(MARK_DELETED_USER . $user_id . MARK_DELETED_USER, MARK_DELETED_USER . $user_id . MARK_DELETED_USER, DELETED, $user_id);
             //updated login_name will be of the kind #17#gurpreet.Here 17 is the user_id, gurpreet is login_name and
             # is serving as delimiter.
             $res = Dal::query($sql, $data);
         }
     }
     // make sure there aren't any lingering entries in networks_users or groups_users
     Network::leave_all_networks($user_id);
     Group::leave_all_groups($user_id);
     Logger::log("Exit: function User::delete");
 }
开发者ID:CivicCommons,项目名称:people-aggregator,代码行数:41,代码来源:User.php


注:本文中的Network::leave_all_networks方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。