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


PHP BaseUser::delete方法代码示例

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


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

示例1: delete

 public function delete($con = null)
 {
     try {
         $con = Propel::getConnection();
         $con->begin();
         //deletes generic document
         $genericDocument = Document::getGenericDocument($this);
         $genericDocument->delete();
         parent::delete();
         $con->commit();
         Document::deleteObjCache($this);
         return true;
     } catch (Exception $e) {
         $con->rollback();
         throw $e;
     }
 }
开发者ID:kotow,项目名称:work,代码行数:17,代码来源:User.php

示例2: delete

 /**
 * Delete this object
 *
 * @param void
 * @return boolean
 */
 function delete() {
   if ($this->isAccountOwner()) {
     return false;
   } // if
   
   ProjectUsers::clearByUser($this);
   MessageSubscriptions::clearByUser($this);
   return parent::delete();
 } // delete
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:15,代码来源:User.class.php

示例3: delete

 /**
  * Delete from database
  *
  * @param void
  * @return boolean
  */
 function delete()
 {
     db_begin_work();
     $delete = parent::delete();
     if ($delete && !is_error($delete)) {
         unlink($this->getAvatarPath());
         unlink($this->getAvatarPath(true));
         ProjectUsers::deleteByUser($this);
         Assignments::deleteByUser($this);
         Subscriptions::deleteByUser($this);
         StarredObjects::deleteByUser($this);
         PinnedProjects::deleteByUser($this);
         UserConfigOptions::deleteByUser($this);
         Reminders::deleteByUser($this);
         search_index_remove($this->getId(), 'User');
         $cleanup = array();
         event_trigger('on_user_cleanup', array(&$cleanup));
         if (is_foreachable($cleanup)) {
             foreach ($cleanup as $table_name => $fields) {
                 foreach ($fields as $field) {
                     $condition = '';
                     if (is_array($field)) {
                         $id_field = array_var($field, 'id');
                         $name_field = array_var($field, 'name');
                         $email_field = array_var($field, 'email');
                         $condition = array_var($field, 'condition');
                     } else {
                         $id_field = $field . '_id';
                         $name_field = $field . '_name';
                         $email_field = $field . '_email';
                     }
                     // if
                     if ($condition) {
                         db_execute('UPDATE ' . TABLE_PREFIX . "{$table_name} SET {$id_field} = 0, {$name_field} = ?, {$email_field} = ? WHERE {$id_field} = ? AND {$condition}", $this->getName(), $this->getEmail(), $this->getId());
                     } else {
                         db_execute('UPDATE ' . TABLE_PREFIX . "{$table_name} SET {$id_field} = 0, {$name_field} = ?, {$email_field} = ? WHERE {$id_field} = ?", $this->getName(), $this->getEmail(), $this->getId());
                     }
                     // if
                 }
                 // foreach
             }
             // foreach
         }
         // if
         db_commit();
         return true;
     } else {
         db_rollback();
         return $delete;
     }
     // if
 }
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:58,代码来源:User.class.php

示例4: forceDelete

 /**
  * Forcibly deletes a user from the DB, taking with it all foreign references
  * to it (pictures, albums, videos, threads, posts, etc, etc).
  *
  * It is very inadvisable to use this method because of the impact that it
  * can have on other users (if, for instance, this user started a thread,
  * that thread will be removed).
  */
 public function forceDelete(PropelPDO $con = null)
 {
     return parent::delete($con);
 }
开发者ID:rayku,项目名称:rayku,代码行数:12,代码来源:User.php

示例5: delete

 /**
  * Delete this object
  *
  * @param void
  * @return boolean
  */
 function delete()
 {
     if ($this->isAccountOwner()) {
         return false;
     }
     // if
     $this->deleteAvatar();
     //$this->deletePersonalProject();
     MailAccountUsers::deleteByUser($this);
     GroupUsers::clearByUser($this);
     Contacts::updateUserIdOnUserDelete($this->getId());
     ProjectUsers::clearByUser($this);
     ObjectSubscriptions::clearByUser($this);
     ObjectReminders::clearByUser($this);
     EventInvitations::clearByUser($this);
     UserPasswords::clearByUser($this);
     return parent::delete();
 }
开发者ID:pnagaraju25,项目名称:fengoffice,代码行数:24,代码来源:User.class.php

示例6: delete

 /**
  * Overrides delete() in App_Model.
  *
  * When an user is deleted, all associated objects are also
  * deleted
  * 
  * @param mixed $where 
  * @access public
  * @return int
  */
 public function delete($where)
 {
     if (is_numeric($where)) {
         $where = $this->_primary . ' = ' . $where;
     }
     $select = new Zend_Db_Select($this->_db);
     $select->from($this->_name);
     $select->where($where);
     $rows = $this->_db->fetchAll($select);
     $userGroupModel = new BackofficeUserGroup();
     foreach ($rows as $row) {
         $userGroupModel->deleteByUserId($row['id']);
     }
     return parent::delete($where);
 }
开发者ID:omusico,项目名称:logica,代码行数:25,代码来源:BackofficeUser.php


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