本文整理汇总了PHP中Openbiz\Openbiz::getObject方法的典型用法代码示例。如果您正苦于以下问题:PHP Openbiz::getObject方法的具体用法?PHP Openbiz::getObject怎么用?PHP Openbiz::getObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Openbiz\Openbiz
的用法示例。
在下文中一共展示了Openbiz::getObject方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
public function render()
{
$sHTML = "";
if (Openbiz::getService('system.lib.ModuleService')->isModuleInstalled('oauth')) {
$do = Openbiz::getObject('oauth.do.OauthProviderDO');
$recArr = $do->directFetch("[status]=1", 30);
$recArr = $recArr->toArray();
if ($this->redirectURL) {
$this->redirectURL = Expression::evaluateExpression($this->redirectURL, $this);
$url_append .= "redirect_url=" . urlencode($this->redirectURL) . "&";
}
if ($this->assocURL) {
$this->assocURL = Expression::evaluateExpression($this->assocURL, $this);
$url_append .= "assoc_url=" . urlencode($this->assocURL) . "&";
}
if (count($recArr)) {
$sHTML .= "<span class=\"oauth_bar\" {$style}>";
foreach ($recArr as $oauthProvider) {
$url = OPENBIZ_APP_URL . "/ws.php/oauth/callback/login/type_" . $oauthProvider['type'] . '/';
if ($url_append) {
$url .= '?' . $url_append;
}
$sHTML .= "<a id=\"oauth_" . $oauthProvider['type'] . "\" title=\"" . $oauthProvider['type'] . "\" href=\"{$url}\" style=\"\"></a>";
}
$sHTML .= "</span>";
}
}
return $sHTML;
}
示例2: setSearchRule
public function setSearchRule()
{
$url = $this->GetURL();
if (!$url) {
return;
}
$this->encodedURL = base64_encode('/' . $url);
$this->tutorialId = Openbiz::getService("help.lib.TutorialService")->getTutorialId('/' . $url);
//search cat_id from mapping table
$mappingObj = Openbiz::getObject($this->categoryMappingDO, 1);
//@todo: $url need to be filtered before use in database
$records = $mappingObj->directFetch("[url]='{$url}'");
if (count($records) == 1) {
$cat_id = (int) $records[0]['cat_id'];
} else {
//if no matched, generate record from category table url_match
$categoryObj = Openbiz::getObject($this->categoryDO, 1);
$records = $categoryObj->directFetch();
foreach ($records as $record) {
$match = $record['url_match'];
if ($match) {
$pattern = "/" . str_replace('/', '\\/', $match) . "/si";
$pattern = "@" . $match . "@si";
if (preg_match($pattern, "/" . $url)) {
$cat_id = $record['Id'];
//cache it into database;
$obj_array = array("cat_id" => $cat_id, "url" => $url);
$mappingObj->insertRecord($obj_array);
break;
}
}
}
}
$this->searchRule = "[category_id]='{$cat_id}'";
}
示例3: getDefaultLangName
public function getDefaultLangName($lang = null)
{
if ($lang == null) {
$do = Openbiz::getObject("myaccount.do.PreferenceDO", 1);
$rec = $do->fetchOne("[user_id]='0' AND [name]='language'");
if ($rec) {
$lang = $rec['value'];
} else {
$lang = OPENBIZ_DEFAULT_LANGUAGE;
}
}
$current_locale = I18n::getCurrentLangCode();
//require_once('Zend/Locale.php');
$locale = new \Zend_Locale($current_locale);
$display_name = \Zend_Locale::getTranslation($lang, 'language', $locale);
if ($display_name) {
return $display_name;
} else {
if ($lang) {
return $lang;
} else {
return OPENBIZ_DEFAULT_LANGUAGE;
}
}
}
示例4: Cleanup
public function Cleanup()
{
$searchRule = "[app_id]=0 OR [install_state]!='OK'";
Openbiz::getObject($this->marketInstalledDO)->deleteRecords($searchRule);
$this->notices = array("cleanup" => $this->getMessage("MSG_CLEANUP"));
$this->rerender();
}
示例5: postLoadingModule
public function postLoadingModule($moduelLoader)
{
$roleRec = Openbiz::getObject("system.do.RoleDO")->fetchOne("[name]='Collaboration Admin'");
$adminRoleId = $roleRec['Id'];
$roleRec = Openbiz::getObject("system.do.RoleDO")->fetchOne("[name]='Data Manager'");
$managerRoleId = $roleRec['Id'];
$roleRec = Openbiz::getObject("system.do.RoleDO")->fetchOne("[name]='Data Assigner'");
$assignerRoleId = $roleRec['Id'];
//set up acls for Data assigner
$actionList = Openbiz::getObject("system.do.AclActionDO")->directfetch("[module]='common' AND [resource]='data_assign'");
foreach ($actionList as $actionRec) {
$actionId = $actionRec["Id"];
$aclRecord = array("role_id" => $assignerRoleId, "action_id" => $actionId, "access_level" => 1);
Openbiz::getObject("system.do.AclRoleActionDO")->insertRecord($aclRecord);
$aclRecord = array("role_id" => $managerRoleId, "action_id" => $actionId, "access_level" => 1);
Openbiz::getObject("system.do.AclRoleActionDO")->insertRecord($aclRecord);
}
//set up acls for Data manager
$actionList = Openbiz::getObject("system.do.AclActionDO")->directfetch("[module]='common' AND [resource]='data_manage'");
foreach ($actionList as $actionRec) {
$actionId = $actionRec["Id"];
$aclRecord = array("role_id" => $managerRoleId, "action_id" => $actionId, "access_level" => 1);
Openbiz::getObject("system.do.AclRoleActionDO")->insertRecord($aclRecord);
}
//delete data manage permission from admin
$actionRec = Openbiz::getObject("system.do.AclActionDO")->fetchOne("[module]='common' AND [resource]='data_manage' AND [action]='manage'");
$actionId = $actionRec['Id'];
Openbiz::getObject("system.do.AclRoleActionDO", 1)->deleteRecords("[role_id]='{$adminRoleId}' AND [action_id]='{$actionId}'");
}
示例6: Finish
public function Finish()
{
$recArr = $this->readInputRecord();
if (count($recArr) == 0) {
return;
}
$user_id = Openbiz::$app->getUserProfile("Id");
$contactImportDO = Openbiz::getObject("contact.do.ContactImportDO");
//process data operation
$data_operation = $recArr['data_operation'];
switch ($data_operation) {
case "0":
break;
case "1":
$contactImportDO->deleteRecords("[user_id]='{$user_id}' AND [selected]='1'");
break;
case "2":
$contactImportDO->deleteRecords("[user_id]='{$user_id}'");
break;
}
if ($this->parentFormName) {
$this->close();
$this->renderParent();
}
$this->processPostAction();
}
示例7: getSystemUserData
public function getSystemUserData($sendContact = 1)
{
//sendContact = 0 ; don't send contact info
//sendContact = 1 ; send contact info
$contactRec = array();
if ($sendContact) {
$profileId = Openbiz::$app->getUserProfile("profile_Id");
$recArr = Openbiz::getObject("contact.do.ContactDO")->fetchById($profileId);
$contactRec['name'] = $recArr['display_name'];
$contactRec['company'] = $recArr['company'];
$contactRec['email'] = $recArr['email'];
$contactRec['mobile'] = $recArr['mobile'];
$contactRec['phone'] = $recArr['phone'];
}
$system_uuid = $this->getSystemUuid();
$system_name = OPENBIZ_DEFAULT_SYSTEM_NAME;
$system_language = OPENBIZ_DEFAULT_LANGUAGE;
$system_url = SITE_URL;
$system_cubi_ver = $this->getVersion();
$system_openbiz_ver = BizSystem::getVersion();
$system_port = $_SERVER['SERVER_PORT'];
$system_admin = $_SERVER['SERVER_ADMIN'];
$internal_ip_address = $_SERVER['SERVER_ADDR'];
if (function_exists("ioncube_server_data")) {
$server_data = ioncube_server_data();
} else {
$server_data = "";
}
$systemRec = array("internal_ipaddr" => $internal_ip_address, "language" => $system_language, "system_name" => $system_name, "system_uuid" => $system_uuid, "system_url" => $system_url, "system_admin" => $system_admin, "system_port" => $system_port, "system_cubi_ver" => $system_cubi_ver, "system_openbiz_ver" => $system_openbiz_ver, "system_server_data" => $server_data);
$params = array("contact_data" => $contactRec, "system_data" => $systemRec);
return $params;
}
示例8: getDefaultRoleID
public function getDefaultRoleID()
{
$roleRec = Openbiz::getObject("system.do.RoleDO")->fetchOne("[default]='1'", "[Id] DESC");
if ($roleRec) {
$Id = $roleRec['Id'];
}
return (int) $Id;
}
示例9: getSelectFrom
public function getSelectFrom()
{
$formname = $this->getFormObj()->parentFormName;
if (!$formname) {
$formname = "extend.widget.ExtendSettingListEditForm";
}
return Openbiz::getObject($formname)->parentFormElementMeta['ATTRIBUTES']['ACCESSSELECTFROM'];
}
示例10: getDefaultMainForm
public function getDefaultMainForm(&$xmlArr)
{
$formObj = Openbiz::getObject("contact.widget.ViewSelectorLeftWidget");
$targetForm = $formObj->getViewMode();
$newForm = array("ATTRIBUTES" => array("NAME" => $targetForm), "VALUE" => null);
$newArr = array($xmlArr, $newForm);
return $newArr;
}
示例11: UpdateRecord
public function UpdateRecord()
{
$result = parent::UpdateRecord();
$mappingObj = Openbiz::getObject($this->categoryMappingDO, 1);
$Id = $this->recordId;
$mappingObj->deleteRecords("[cat_id]='{$Id}'");
return $result;
}
示例12: Report
public function Report()
{
//send an email to admin includes error messages;
$system_uuid = Openbiz::getService("system.lib.CubiService")->getSystemUUID();
$report = array("system_uuid" => $system_uuid, "error_info" => $this->errors["system"], "server_info" => $_SERVER, "php_version" => phpversion(), "php_extension" => get_loaded_extensions());
$reportId = Openbiz::getObject("common.lib.ErrorReportService")->report($report);
$this->notices = array("status" => "REPORTED", "report_id" => $reportId);
$this->ReRender();
}
示例13: postLoadingModule
public function postLoadingModule($moduelLoader)
{
$roleRec = Openbiz::getObject("system.do.RoleDO")->fetchOne("[name]='Cubi Member'");
$roleId = $roleRec['Id'];
$actionRec = Openbiz::getObject("system.do.AclActionDO")->fetchOne("[module]='chart' AND [resource]='Chart' AND [action]='View_Chart'");
$actionId = $actionRec["Id"];
$aclRecord = array("role_id" => $roleId, "action_id" => $actionId, "access_level" => 1);
Openbiz::getObject("system.do.AclRoleActionDO")->insertRecord($aclRecord);
}
示例14: _doCreateUser
protected function _doCreateUser()
{
$recArr = $this->readInputRecord();
$this->setActiveRecord($recArr);
if (count($recArr) == 0) {
return;
}
if ($this->_checkDupUsername()) {
$errorMessage = $this->GetMessage("USERNAME_USED");
$errors['fld_username'] = $errorMessage;
$this->processFormObjError($errors);
return;
}
if ($this->_checkDupEmail()) {
$errorMessage = $this->GetMessage("EMAIL_USED");
$errors['fld_email'] = $errorMessage;
$this->processFormObjError($errors);
return;
}
try {
$this->ValidateForm();
} catch (Openbiz\Validation\Exception $e) {
$this->processFormObjError($e->errors);
return;
}
$recArr['create_by'] = "0";
$recArr['update_by'] = "0";
$password = Openbiz::$app->getClientProxy()->GetFormInputs("fld_password");
$recArr['password'] = hash(HASH_ALG, $password);
$this->_doInsert($recArr);
//set default user role to member
$userinfo = $this->getActiveRecord();
$userRoleObj = Openbiz::getObject('system.do.UserRoleDO');
foreach (Openbiz::getObject('system.do.RoleDO')->directfetch("[default]='1'") as $roleRec) {
$roleId = $roleRec['Id'];
$uesrRoleArr = array("user_id" => $userinfo['Id'], "role_id" => $roleId);
$userRoleObj->insertRecord($uesrRoleArr);
}
//set default group to member
$userGroupObj = Openbiz::getObject('system.do.UserGroupDO');
foreach (Openbiz::getObject('system.do.GroupDO')->directfetch("[default]='1'") as $groupRec) {
$groupId = $groupRec['Id'];
$uesrGroupArr = array("user_id" => $userinfo['Id'], "group_id" => $groupId);
$userGroupObj->insertRecord($uesrGroupArr);
}
//record event log
$eventlog = Openbiz::getService(OPENBIZ_EVENTLOG_SERVICE);
$logComment = array($userinfo['username'], $_SERVER['REMOTE_ADDR']);
$eventlog->log("USER_MANAGEMENT", "MSG_USER_REGISTERED", $logComment);
//send user email
$emailObj = Openbiz::getService(CUBI_USER_EMAIL_SERVICE);
$emailObj->UserWelcomeEmail($userinfo['Id']);
//init profile for future use like redirect to my account view
$profile = Openbiz::$app->InituserProfile($userinfo['username']);
return $userinfo;
}
示例15: _getProviderInfo
protected function _getProviderInfo()
{
$SmsProviderDO = Openbiz::getObject($this->providerDo);
$recObj = $SmsProviderDO->fetchOne("[Id]={$this->providerId}");
$recArr = array();
if ($recObj) {
$recArr = $recObj->toArray();
}
return $recArr;
}