本文整理汇总了PHP中Persona::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Persona::delete方法的具体用法?PHP Persona::delete怎么用?PHP Persona::delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Persona
的用法示例。
在下文中一共展示了Persona::delete方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
case 1:
$result = $a->save($_POST);
if ($result != false) {
if ($result == 1) {
$result = "finCorrecto";
}
} else {
$result = "errorAlta";
}
break;
case 3:
$result = $a->editarPersona($_POST);
if ($result != false) {
$result = "finCorrecto";
} else {
$result = "errorUpdate";
}
break;
case 2:
$result = $a->delete($_POST['id']);
if ($result) {
$result = "finCorrecto";
} else {
$result = "errorBorrar";
}
break;
default:
break;
}
echo $result;
}
示例2: catch
try {
$persona->load($persona_id);
} catch (PAException $e) {
// this is usually because the Persona has already been deleted
// and thus doen't exist
Logger::log("ERROR: trying to delete Persona: " . $persona_id . "\n" . $e->getMessage());
$msg = "Couldn't disconnect the Service.<br />" . $e->getMessage();
// we do not throw this
}
if ($persona->user_id) {
// check if Persona belongs to user
if ($persona->user_id != $user->user_id) {
$msg = "Couldn't disconnect the Service.<br />It is not associated with your account";
} else {
// ok, let's kill it
Persona::delete($persona_id);
$msg = "The service has been successfully disconnected.";
}
}
}
if (@$_POST['profile_type'] == 'external') {
global $msg;
// so it will be seen in page creation context
// let's see if this is a configure_XYZ call
$config_call = false;
foreach ($_POST as $k => $v) {
if (preg_match('/^configure_/', $k)) {
$config_call = $k;
}
}
if ($config_call) {
示例3: session_start
<?php
session_start();
require_once '../../twig/lib/Twig/Autoloader.php';
require_once '../../../Model/BinDb.php';
require_once '../../../Model/Persona.php';
if ($_SESSION['logeado'] == "Si") {
if (isset($_POST['codigo_persona'])) {
$codigo_persona = $_POST['codigo_persona'];
if (!empty($codigo_persona)) {
$aRespuesta = ['estado' => Persona::delete($codigo_persona)];
echo json_encode($aRespuesta);
}
}
} else {
header("Location: /Controller/partePublica/actividades.php");
}