/** * @param CTenant $oTenant */ public function UpdateTenantAdminObject($oTenant) { $bResult = false; $iTenantId = $this->oAdminPanel->TenantId(); if ($this->oTenantsApi && $oTenant && (0 === $iTenantId || 0 < $iTenantId && $iTenantId === $oTenant->IdTenant)) { $bResult = $this->oTenantsApi->updateTenant($oTenant); } return $bResult; }
public function AjaxSocialAccountGet() { $mResult = false; $oTenant = null; $oAccount = $this->GetDefaultAccount(); $sType = trim($this->getParamValue('Type', '')); if ($oAccount && $this->oApiTenants) { $oTenant = 0 < $oAccount->IdTenant ? $this->oApiTenants->getTenantById($oAccount->IdTenant) : $this->oApiTenants->getDefaultGlobalTenant(); } if ($oTenant) { $oApiSocial = \CApi::Manager('social'); $mResult = $oApiSocial->getSocial($oAccount->IdAccount, $sType); } return $this->DefaultResponse(null, __FUNCTION__, $mResult); }
public function AjaxSocialAccountDelete() { $mResult = false; $oTenant = null; $oAccount = $this->GetDefaultAccount(); if ($oAccount && $this->oApiTenants) { $oTenant = (0 < $oAccount->IdTenant) ? $this->oApiTenants->GetTenantById($oAccount->IdTenant) : $this->oApiTenants->GetDefaultGlobalTenant(); } if ($oTenant) { $iType = (int) trim($this->getParamValue('Type', 0)); $oApiSocial /* @var $oApiSocial \CApiSocialManager */ = \CApi::Manager('social'); $mResult = $oApiSocial->DeleteSocial($oAccount->IdAccount, $iType); } return $this->DefaultResponse(null, __FUNCTION__, $mResult); }