本文整理汇总了PHP中SugarController::loadBean方法的典型用法代码示例。如果您正苦于以下问题:PHP SugarController::loadBean方法的具体用法?PHP SugarController::loadBean怎么用?PHP SugarController::loadBean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SugarController
的用法示例。
在下文中一共展示了SugarController::loadBean方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadBean
/**
* @see SugarController::loadBean()
*/
public function loadBean()
{
if (!empty($_REQUEST['record']) && $_REQUEST['action'] == 'ReportsWizard') {
$_REQUEST['id'] = $this->record;
$_REQUEST['page'] = 'report';
$this->view_object_map['action'] = 'ReportsWizard';
} else {
if (empty($this->record) && !empty($_REQUEST['id'])) {
$this->record = $_REQUEST['id'];
$GLOBALS['action'] = 'detailview';
$this->view_object_map['action'] = 'ReportCriteriaResults';
} elseif (!empty($this->record)) {
if ($_REQUEST['action'] == 'DetailView') {
$_REQUEST['id'] = $this->record;
unset($_REQUEST['record']);
} else {
$GLOBALS['action'] = 'detailview';
//bug 41860
}
$_REQUEST['page'] = 'report';
$this->view_object_map['action'] = 'ReportCriteriaResults';
}
}
parent::loadBean();
}
示例2: testaction_save
public function testaction_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->action_save();
} catch (Exception $e) {
$this->assertStringStartsWith('mysqli_query()', $e->getMessage());
}
$this->assertTrue(true);
}