本文整理汇总了PHP中DBObjectSearch::Serialize方法的典型用法代码示例。如果您正苦于以下问题:PHP DBObjectSearch::Serialize方法的具体用法?PHP DBObjectSearch::Serialize怎么用?PHP DBObjectSearch::Serialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBObjectSearch
的用法示例。
在下文中一共展示了DBObjectSearch::Serialize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: DeleteObjects
//.........这里部分代码省略.........
} else {
$oP->p(Dict::S('UI:Delete:PleaseDoTheManualOperations'));
}
$oAppContext = new ApplicationContext();
$oP->add("<form method=\"post\">\n");
$oP->add("<input type=\"hidden\" name=\"transaction_id\" value=\"" . utils::ReadParam('transaction_id') . "\">\n");
$oP->add("<input type=\"button\" onclick=\"window.history.back();\" value=\"" . Dict::S('UI:Button:Back') . "\">\n");
$oP->add("<input DISABLED type=\"submit\" name=\"\" value=\"" . Dict::S('UI:Button:Delete') . "\">\n");
$oP->add($oAppContext->GetForForm());
$oP->add("</form>\n");
} else {
if (count($aObjects) == 1) {
$oObj = $aObjects[0];
$id = $oObj->GetKey();
$oP->p('<h1>' . Dict::Format('UI:Delect:Confirm_Object', $oObj->GetHyperLink()) . '</h1>');
} else {
$oP->p('<h1>' . Dict::Format('UI:Delect:Confirm_Count_ObjectsOf_Class', count($aObjects), MetaModel::GetName($sClass)) . '</h1>');
}
foreach ($aObjects as $oObj) {
$aKeys[] = $oObj->GetKey();
}
$oFilter = new DBObjectSearch($sClass);
$oFilter->AddCondition('id', $aKeys, 'IN');
$oSet = new CMDBobjectSet($oFilter);
$oP->add('<div id="0">');
CMDBAbstractObject::DisplaySet($oP, $oSet, array('display_limit' => false, 'menu' => false));
$oP->add("</div>\n");
$oP->add("<form method=\"post\">\n");
foreach ($aContextData as $sKey => $value) {
$oP->add("<input type=\"hidden\" name=\"{$sKey}\" value=\"{$value}\">\n");
}
$oP->add("<input type=\"hidden\" name=\"transaction_id\" value=\"" . utils::GetNewTransactionId() . "\">\n");
$oP->add("<input type=\"hidden\" name=\"operation\" value=\"{$sCustomOperation}\">\n");
$oP->add("<input type=\"hidden\" name=\"filter\" value=\"" . $oFilter->Serialize() . "\">\n");
$oP->add("<input type=\"hidden\" name=\"class\" value=\"{$sClass}\">\n");
foreach ($aObjects as $oObj) {
$oP->add("<input type=\"hidden\" name=\"selectObject[]\" value=\"" . $oObj->GetKey() . "\">\n");
}
$oP->add("<input type=\"button\" onclick=\"window.history.back();\" value=\"" . Dict::S('UI:Button:Back') . "\">\n");
$oP->add("<input type=\"submit\" name=\"\" value=\"" . Dict::S('UI:Button:Delete') . "\">\n");
$oAppContext = new ApplicationContext();
$oP->add($oAppContext->GetForForm());
$oP->add("</form>\n");
}
} else {
// Execute the deletion
//
if (count($aObjects) == 1) {
$oObj = $aObjects[0];
$oP->add("<h1>" . Dict::Format('UI:Title:DeletionOf_Object', $oObj->GetName()) . "</h1>\n");
} else {
$oP->add("<h1>" . Dict::Format('UI:Title:BulkDeletionOf_Count_ObjectsOf_Class', count($aObjects), MetaModel::GetName($sClass)) . "</h1>\n");
}
// Security - do not allow the user to force a forbidden delete by the mean of page arguments...
if ($oDeletionPlan->FoundSecurityIssue()) {
throw new CoreException(Dict::S('UI:Error:NotEnoughRightsToDelete'));
}
if ($oDeletionPlan->FoundManualOperation()) {
throw new CoreException(Dict::S('UI:Error:CannotDeleteBecauseManualOpNeeded'));
}
if ($oDeletionPlan->FoundManualDelete()) {
throw new CoreException(Dict::S('UI:Error:CannotDeleteBecauseOfDepencies'));
}
// Report deletions
//
$aDisplayData = array();