本文整理汇总了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;
}
}
示例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
示例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
}
示例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);
}
示例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();
}
示例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);
}