本文整理汇总了PHP中SugarController::pre_save方法的典型用法代码示例。如果您正苦于以下问题:PHP SugarController::pre_save方法的具体用法?PHP SugarController::pre_save怎么用?PHP SugarController::pre_save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SugarController
的用法示例。
在下文中一共展示了SugarController::pre_save方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pre_save
public function pre_save()
{
$this->pre_operation = $this->bean->operation;
$this->pre_quantity = $this->bean->quantity;
$this->pre_xinventory_id = $this->bean->xinventory_id;
parent::pre_save();
}
示例2: testpre_save
public function testpre_save()
{
$SugarController = new SugarController();
$SugarController->setModule('Users');
$SugarController->loadBean();
//execute the method and check if it either works or throws an mysql exception.
//Fail if it throws any other exception.
try {
$SugarController->pre_save();
} catch (Exception $e) {
$this->assertStringStartsWith('mysqli_query()', $e->getMessage());
}
$this->assertTrue(true);
}
示例3: pre_save
public function pre_save()
{
parent::pre_save();
require_once 'modules/Workflows/includes/WorkflowBaseAction.php';
if (isset($this->bean->accion) && isset($this->record)) {
$accion = WorkflowBaseAction::obtener_accion_por_nombre($this->bean->accion);
try {
$accion->verificar_parametros($this->bean->parametros);
} catch (Exception $e) {
sugar_set_message("No se encontraron los parametros: " . implode(', ', $accion->parametros_requeridos()) . "; para la acción: {$accion->nombre}. No se Guardaron los cambios", "error");
$args = array('module' => $this->module, 'action' => "EditView", 'record' => $this->record);
$this->set_redirect(create_url($args));
$this->redirect();
die;
}
}
}
示例4: pre_save
public function pre_save()
{
parent::pre_save();
$this->api = ExternalAPIFactory::loadAPI($this->bean->application, true);
if (empty($this->api)) {
return $this->failed(translate('LBL_AUTH_UNSUPPORTED', $this->bean->module_dir));
}
if (empty($this->bean->id)) {
$eapmBean = EAPM::getLoginInfo($this->bean->application, true);
if ($eapmBean) {
SugarApplication::appendErrorMessage(translate('LBL_APPLICATION_FOUND_NOTICE', $this->bean->module_dir));
$this->bean->id = $eapmBean->id;
}
}
$this->bean->validated = false;
$this->bean->save_cleanup();
$this->api->loadEAPM($this->bean);
}