本文整理汇总了PHP中Member::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Member::delete方法的具体用法?PHP Member::delete怎么用?PHP Member::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Member
的用法示例。
在下文中一共展示了Member::delete方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cleanup
/**
* removes the temporary user
* and cleans up the curl connection.
*
*/
private function cleanup()
{
if ($this->member) {
$this->member->delete();
}
curl_close($this->ch);
}
示例2: execute
function execute()
{
$return = new stdClass();
$params = Request::_REQUEST();
Config::set("HideDebugger", true);
if (isset($params['id'])) {
if ($params['id'] == Config::get("Member")->getID()) {
$return->error = "ID matches logged in ID and cannot delete!";
echo json_encode($return);
return;
}
$user = new Member($params["id"]);
if (isset($user) && $user->isValid()) {
$user->delete();
$return->id = $params['id'];
$return->deleted = true;
echo json_encode($return);
return;
} else {
$return->error = "ID is invalid!";
echo json_encode($return);
return;
}
} else {
$return->error = "Missing ID!";
echo json_encode($return);
return;
}
}
示例3: testDeletesOpauthIdentityOnDelete
public function testDeletesOpauthIdentityOnDelete()
{
$member = new Member(array('Email' => 'test@test.com'));
$member->write();
$identity = new OpauthIdentity();
$identity->write();
$member->OpauthIdentities()->add($identity);
$member->delete();
$this->assertEquals(0, $member->OpauthIdentities()->Count());
}
示例4: testMemberSpecialCleanup
public function testMemberSpecialCleanup() {
// Member relations are configured to be handled in the last
// second by JanitorMemberDecorator, be sure that the hack
// works as expected.
$member = new Member();
$member->Email = 'email@example.com';
$member->Password = 'hunter2';
$member->write();
$memberID = $member->ID;
$member->Password = 'hunter3';
$member->write();
$this->assertEquals(2, DataObject::get('MemberPassword', "\"MemberID\" = {$memberID}")->Count(),
"MemberPassword cleaned prematurely");
$member->delete();
$this->assertFalse((bool)DataObject::get('MemberPassword', "\"MemberID\" = {$memberID}"),
"MemberPassword not cleaned propely");
}
示例5: delete
public function delete()
{
if ($this->canDelete(Member::currentUser())) {
parent::delete();
}
}
示例6: deleteMember
function deleteMember()
{
$member = new Member(array("id" => isset($_POST["memberId"]) ? (int) $_POST["memberId"] : ""));
LogEntry::deleteAllForMember($member->getValue("id"));
$member->delete();
displaySuccess();
}
示例7:
var_dump($result);
//2件目のデータを登録
$member->set(array('name' => 'テスト名2', 'age' => 31, 'email' => 'test2@example.com'));
$result = $member->insert();
var_dump($result);
//1件目と同じデータを登録
$member->set(array('name' => 'テスト名', 'age' => 30, 'email' => 'test@example.com'));
$result = $member->insert();
var_dump($result);
// 引数で指定されたメールアドレスのユーザーを members テーブルから探し、
// もし見つかった場合、そのデータを以下の形式で返します。
// array(
// 'id' => 'members テーブル の id カラムの値',
// 'name' => 'members テーブル の name カラムの値',
// 'age' => 'members テーブル の age カラムの値',
// 'email' => 'members テーブル の email カラムの値',
// 'created_at' => 'members テーブル の created_at カラムの値',
// );
// ユーザーが見つからなかった場合、false を返します。
$data = $member->findByEmail('test@example.com');
var_dump($data);
// 引数で指定された id を持つ members テーブルのレコードを削除します。
// 削除が成功した場合は true 、失敗した場合は false を返します。
$result = $member->delete($data['id']);
var_dump($result);
//削除後のデータを削除
$result = $member->delete($data['id']);
var_dump($result);
// ここでは false が返ってくるはずです。
$data = $member->findByEmail('test@example.co');
var_dump($data);
示例8: Member
$countErrors = 0;
if ($_POST['submit']) {
$delMemberObj = new Member($mysqli);
if (!$delMemberObj->select($_POST['deletemember']) || !is_numeric($_POST['deletemember'])) {
$dispError = " <b>·</b> You selected an invalid member.<br>";
$countErrors++;
} else {
// Check if member is disabled
if ($delMemberObj->get_info("disabled") != 1) {
$dispError = " <b>·</b> You may only delete members who are currently disabled.<br>";
$countErrors++;
}
}
if ($countErrors == 0) {
$delMemberUsername = $delMemberObj->get_info_filtered("username");
if ($delMemberObj->delete()) {
echo "\n\t\t\t\n\t\t\t\n\t\t\t\t<div style='display: none' id='successBox'>\n\t\t\t\t\t<p align='center'>\n\t\t\t\t\t\tSuccessfully deleted " . $delMemberUsername . " from the website!\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\tpopupDialog('Delete Member', '" . $MAIN_ROOT . "members', 'successBox');\n\t\t\t\t</script>\n\t\t\t\n\t\t\t\n\t\t\t";
$member->logAction("Deleted " . $delMemberUsername . " from the website.");
} else {
$countErrors++;
$dispError .= " <b>·</b> Unable to delete member from the database. Please contact the website administrator.<br>";
}
}
if ($countErrors > 0) {
$_POST['submit'] = false;
}
}
if (!$_POST['submit']) {
$memberoptions = "";
$result = $mysqli->query("SELECT * FROM " . $dbprefix . "members WHERE disabled = '1' ORDER BY username");
while ($row = $result->fetch_assoc()) {
示例9: Member
<?php
include "_setup.php";
include_once "classes/member.php";
$member = new Member($mysqli);
if ($_POST['submit']) {
if ($member->select($_POST['adminaccount']) && $member->delete()) {
echo "Admin Account Deleted!<br><br>";
}
}
$result = $mysqli->query("SELECT * FROM " . $dbprefix . "members WHERE rank_id = '1'");
while ($row = $result->fetch_assoc()) {
$options .= "<option value='" . $row['member_id'] . "'>" . $row['username'] . "</option>";
}
echo "\n\n\t<form action='deleteadminaccount.php' method='post'>\n\t\n\t\tAdmin Account: <select name='adminaccount'>" . $options . "</select><br>\n\t\t<input type='submit' name='submit' value='Delete Account'>\n\t\n\t</form>\n\n\t<br><br>\n\t<a href='resetadminpassword.php'>Reset Admin Account Password</a>\n\n";
示例10: Member
<?php
require_once './resource/models/member.php';
if ($_POST['member_id']) {
$member = new Member();
if ($_POST["member_id"] != "") {
$member->setId($_POST["member_id"]);
$result = $member->delete();
if ($result) {
$message = "<p class=\"message success\"><i class=\"material-icons\">done</i>Member deleted!</p>";
} else {
$message = "<p class=\"message error\"><i class=\"material-icons\">error</i>Error: Member was not deleted</p>";
}
} else {
$message = "<p class=\"message error\"><i class=\"material-icons\">error</i>Error: Blank member ID specified in POST request</p>";
}
} else {
$message = "<p class=\"message error\"><i class=\"material-icons\">error</i>Error: No member ID specified in POST request</p>";
}
示例11: delete
/**
* 删除当前管理员
*
* @see OOP_ORM_Data::delete()
* @return integer 操作行数
* @throws \Exception
*/
public function delete()
{
$id = $this->id;
$rs = parent::delete();
if ($rs) {
# 删除管理员对应的用户组设置
$orm_group = new \ORM_Admin_MemberGroup_Finder();
$orm_group->db()->where('admin_id', $id)->delete($orm_group->ids_tablename());
}
return $rs;
}