本文整理汇总了PHP中CDoObjectAddEdit::errorRedirect方法的典型用法代码示例。如果您正苦于以下问题:PHP CDoObjectAddEdit::errorRedirect方法的具体用法?PHP CDoObjectAddEdit::errorRedirect怎么用?PHP CDoObjectAddEdit::errorRedirect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDoObjectAddEdit
的用法示例。
在下文中一共展示了CDoObjectAddEdit::errorRedirect方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CMedecin
$medecin1 = new CMedecin();
$medecin1->load($_POST["medecin1_id"]);
$medecin2 = new CMedecin();
$medecin2->load($_POST["medecin2_id"]);
$do = new CDoObjectAddEdit("CMedecin", "medecin_id");
$do->doBind();
// Création du nouveau medecin
if (intval(CValue::post("del"))) {
$do->doDelete();
} else {
$do->doStore();
}
/** @var CMedecin $newMedecin */
$newMedecin =& $do->_obj;
// Transfert de toutes les backrefs
if ($msg = $newMedecin->transferBackRefsFrom($medecin1)) {
$do->errorRedirect($msg);
}
if ($msg = $newMedecin->transferBackRefsFrom($medecin2)) {
$do->errorRedirect($msg);
}
// Suppression des anciens objets
if ($msg = $medecin1->delete()) {
$do->errorRedirect($msg);
}
if ($msg = $medecin2->delete()) {
$do->errorRedirect($msg);
}
$medecin1->delete();
$medecin2->delete();
$do->doRedirect();
示例2: array
$objects_class = CValue::post("_objects_class");
$base_object_id = CValue::post("_base_object_id");
$del = CValue::post("del");
$fast = CValue::post("fast");
CApp::setMemoryLimit("512M");
// If the class is valid
if (class_exists($objects_class)) {
$objects = array();
$do = new CDoObjectAddEdit($objects_class);
// If alt mode, load the specified object
if ($base_object_id) {
$do->_obj->load($base_object_id);
}
// Création du nouvel objet
if (intval($del)) {
$do->errorRedirect("Fusion en mode suppression impossible");
}
// Unset the base_object from the list
if ($do->_obj->_id) {
foreach ($objects_id as $key => $object_id) {
if ($do->_obj->_id == $object_id) {
unset($objects_id[$key]);
unset($_POST["_merging"][$base_object_id]);
}
}
// Only one objet to merge
$objects_id = array(reset($objects_id));
}
foreach ($objects_id as $object_id) {
$object = new $objects_class();
// the CMbObject is loaded