本文整理汇总了PHP中api_AContainer类的典型用法代码示例。如果您正苦于以下问题:PHP api_AContainer类的具体用法?PHP api_AContainer怎么用?PHP api_AContainer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了api_AContainer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: DbInsertArrays
/**
* @param object $oObject
* @param object $oHelper
* @return array
*/
public static function DbInsertArrays($oObject, $oHelper)
{
$aResult = array(false, false);
$sQueryParams = '';
$bUseLogQueryParams = (bool) CApi::GetConf('labs.db.log-query-params', false);
$oObject->initBeforeChange();
$aStaticMap = $oObject->getMap();
$aMap = api_AContainer::DbWriteKeys($aStaticMap, true);
$aDbKeys = array_keys($aMap);
$aResult[0] = array_map(array(&$oHelper, 'EscapeColumn'), $aDbKeys);
$aDbValues = array_values($aMap);
foreach ($aDbValues as $iIndex => $sKey) {
$mValue = $oObject->{$sKey};
if (isset($aStaticMap[$sKey][0])) {
if ('password' === $aStaticMap[$sKey][0]) {
$mValue = api_Utils::EncodePassword($mValue);
} else {
if ('datetime' === $aStaticMap[$sKey][0]) {
$mValue = $oHelper->TimeStampToDateFormat($mValue);
} else {
if ('serialize' === $aStaticMap[$sKey][0]) {
$mValue = '' === $mValue ? '' : serialize($mValue);
}
}
}
}
$aDbValues[$iIndex] = is_string($mValue) ? $oHelper->EscapeString($mValue) : (int) $mValue;
if ($bUseLogQueryParams) {
$sDbKey = isset($aDbKeys[$iIndex]) ? $aDbKeys[$iIndex] : '!unknown!';
$sQueryParams .= API_CRLF . API_TAB . $sDbKey . ' = ' . $aDbValues[$iIndex];
}
}
$aResult[1] = $aDbValues;
if ($bUseLogQueryParams) {
CApi::Log($sQueryParams);
}
return $aResult;
}
示例2: _getUserByWhereQuery
/**
* Returns query-string for obtaining user by specified condition.
*
* @param string $sWhere Specified condition.
*
* @return string
*/
protected function _getUserByWhereQuery($sWhere)
{
$aMap = api_AContainer::DbReadKeys(CUser::getStaticMap());
$aMap = array_map(array($this, 'escapeColumn'), $aMap);
$sSql = 'SELECT %s FROM %sawm_settings WHERE %s';
return sprintf($sSql, implode(', ', $aMap), $this->prefix(), $sWhere);
}
示例3: getAccountByWhere
/**
* @param string $sWhere
* @return string
*/
protected function getAccountByWhere($sWhere)
{
$aMap = api_AContainer::DbReadKeys(CTwofactorauth::getStaticMap());
$aMap = array_map(array($this, 'escapeColumn'), $aMap);
$sSql = 'SELECT %s FROM %stwofa_accounts WHERE %s';
return sprintf($sSql, implode(', ', $aMap), $this->prefix(), $sWhere);
}
示例4: getSocialByWhere
/**
* @param string $sWhere
* @return string
*/
protected function getSocialByWhere($sWhere)
{
$aMap = api_AContainer::DbReadKeys(CSocial::GetStaticMap());
$aMap = array_map(array($this, 'escapeColumn'), $aMap);
$sSql = 'SELECT %s FROM %sawm_social WHERE %s';
return sprintf($sSql, implode(', ', $aMap), $this->Prefix(), $sWhere);
}
示例5: updateSubscription
/**
* @param CSubscription $oSubscription
*
* @return string
*/
public function updateSubscription($oSubscription)
{
$aResult = api_AContainer::DbUpdateArray($oSubscription, $this->oHelper);
$sSql = 'UPDATE %sawm_fetchers SET %s WHERE %s = %d AND %s = %d';
return sprintf($sSql, $this->prefix(), implode(', ', $aResult), $this->escapeColumn('id_tenant'), $oSubscription->IdTenant, $this->escapeColumn('id_subscription'), $oSubscription->IdSubscription);
}
示例6: __construct
/**
* @param CAccount $oAccount
*/
public function __construct(CAccount $oAccount)
{
parent::__construct(get_class($this));
$this->SetTrimer(array('Name', 'Signature', 'IncomingMailServer', 'IncomingMailLogin', 'IncomingMailPassword', 'OutgoingMailServer'));
$this->SetLower(array('IncomingMailServer', 'OutgoingMailServer'));
$this->SetDefaults(array('IdFetcher' => 0, 'IdAccount' => $oAccount->IdAccount, 'IdUser' => $oAccount->IdUser, 'IdDomain' => $oAccount->IdDomain, 'IdTenant' => $oAccount->IdTenant, 'IsEnabled' => true, 'IsLocked' => false, 'CheckInterval' => 0, 'CheckLastTime' => 0, 'Name' => '', 'Email' => '', 'Signature' => '', 'SignatureOptions' => EAccountSignatureOptions::DontAdd, 'LeaveMessagesOnServer' => true, 'IncomingMailServer' => '', 'IncomingMailPort' => 110, 'IncomingMailLogin' => '', 'IncomingMailPassword' => '', 'IncomingMailSecurity' => \MailSo\Net\Enumerations\ConnectionSecurityType::NONE, 'IsOutgoingEnabled' => false, 'OutgoingMailServer' => '', 'OutgoingMailPort' => 25, 'OutgoingMailAuth' => true, 'OutgoingMailSecurity' => \MailSo\Net\Enumerations\ConnectionSecurityType::NONE, 'Folder' => 'INBOX'));
}
示例7: __construct
/**
* @param CDomain $oDomain
* @return void
*/
public function __construct()
{
parent::__construct(get_class($this), 'IdIdentity');
$this->SetTrimer(array('Email', 'FriendlyName'));
$this->SetDefaults(array('IdIdentity' => 0, 'IdUser' => 0, 'IdAccount' => 0, 'Virtual' => false, 'Default' => false, 'Enabled' => true, 'Email' => '', 'FriendlyName' => '', 'Signature' => '', 'SignatureType' => EAccountSignatureType::Html, 'UseSignature' => false));
CApi::Plugin()->RunHook('api-identity-construct', array(&$this));
}
示例8: __construct
public function __construct()
{
parent::__construct(get_class($this));
$this->SetTrimer(array('Subject'));
$this->Owner = null;
$this->SetDefaults(array('IdHelpdeskThread' => 0, 'StrHelpdeskThreadHash' => trim(base_convert(md5(microtime(true) . rand(1000, 9999)), 16, 32), '0'), 'IdTenant' => 0, 'IdOwner' => 0, 'ItsMe' => false, 'IsArchived' => false, 'Type' => EHelpdeskThreadType::None, 'Subject' => '', 'Created' => time(), 'Updated' => time(), 'PostCount' => 0, 'LastPostId' => 0, 'LastPostOwnerId' => 0, 'Notificated' => false, 'HasAttachments' => false, 'IsRead' => false));
}
示例9: __construct
public function __construct()
{
parent::__construct(get_class($this));
$this->SetTrimer(array('Name', 'Email', 'PasswordHash'));
$this->SetLower(array('Email'));
$oSettings =& CApi::GetSettings();
$this->SetDefaults(array(
'IdHelpdeskUser' => 0,
'IdSystemUser' => 0,
'IdTenant' => 0,
'Activated' => false,
'Blocked' => false,
'IsAgent' => false,
// 'IsSocial' => false,
'Name' => '',
'Email' => '',
'NotificationEmail' => '',
'SocialId' => '',
'SocialType' => '',
'ActivateHash' => md5(microtime(true).rand(1000, 9999)),
'Language' => $oSettings->GetConf('Common/DefaultLanguage'),
'DateFormat' => $oSettings->GetConf('Common/DefaultDateFormat'),
'TimeFormat' => $oSettings->GetConf('Common/DefaultTimeFormat'),
'NotificationPassword' => '',
'PasswordHash' => '',
'PasswordSalt' => md5(microtime(true).rand(10000, 99999)),
'MailNotifications' => false,
'Created' => time()
));
}
示例10: __construct
public function __construct()
{
parent::__construct(get_class($this));
$this->SetDefaults(array(
'Id' => '',
'Type' => EFileStorageType::Personal,
'Path' => '',
'Name' => '',
'Size' => 0,
'IsFolder' => false,
'IsLink' => false,
'LinkType' => EFileStorageLinkType::Unknown,
'LinkUrl' => '',
'LastModified' => 0,
'ContentType' => '',
'Thumb' => false,
'ThumbnailLink' => '',
'Hash' => '',
'Shared' => false,
'Owner' => '',
'Content' => '',
'IsExternal' => false
));
}
示例11: __construct
public function __construct()
{
parent::__construct(get_class($this));
$this->SetTrimer(array('Text'));
$this->Owner = null;
$this->Attachments = null;
$this->SetDefaults(array('IdHelpdeskPost' => 0, 'IdHelpdeskThread' => 0, 'IdTenant' => 0, 'IdOwner' => 0, 'Type' => EHelpdeskPostType::Normal, 'SystemType' => EHelpdeskPostSystemType::None, 'Created' => time(), 'IsThreadOwner' => true, 'ItsMe' => false, 'Text' => ''));
}
示例12: InitBeforeChange
/**
* @return bool
*/
public function InitBeforeChange()
{
parent::InitBeforeChange();
if (0 === strlen($this->IdGroupStr)) {
$this->IdGroupStr = $this->GenerateStrId();
}
return true;
}
示例13: __construct
public function __construct($sLogin = '', $Description = '')
{
parent::__construct(get_class($this), 'IdTenant');
$this->__USE_TRIM_IN_STRINGS__ = true;
$oSettings =& CApi::GetSettings();
$this->SetDefaults(array('IdTenant' => 0, 'IdChannel' => 0, 'IsDisabled' => false, 'IsDefault' => false, 'Login' => $sLogin, 'Email' => '', 'PasswordHash' => '', 'Description' => $Description, 'IsEnableAdminPanelLogin' => false, 'QuotaInMB' => 0, 'AllocatedSpaceInMB' => 0, 'FilesUsageInBytes' => '0', 'FilesUsageInMB' => 0, 'FilesUsageDynamicQuotaInMB' => 0, 'UserCountLimit' => 0, 'DomainCountLimit' => 0, 'Capa' => (string) $oSettings->GetConf('Common/TenantGlobalCapa'), 'AllowChangeAdminEmail' => true, 'AllowChangeAdminPassword' => true, 'Expared' => 0, 'PayUrl' => '', 'IsTrial' => false, 'HelpdeskAdminEmailAccount' => '', 'HelpdeskClientIframeUrl' => '', 'HelpdeskAgentIframeUrl' => '', 'HelpdeskSiteName' => '', 'HelpdeskStyleAllow' => false, 'HelpdeskStyleImage' => '', 'HelpdeskStyleText' => '', 'LoginStyleImage' => '', 'AppStyleImage' => '', 'HelpdeskFacebookAllow' => !!$oSettings->GetConf('Helpdesk/FacebookAllow'), 'HelpdeskFacebookId' => (string) $oSettings->GetConf('Helpdesk/FacebookId'), 'HelpdeskFacebookSecret' => (string) $oSettings->GetConf('Helpdesk/FacebookSecret'), 'HelpdeskGoogleAllow' => !!$oSettings->GetConf('Helpdesk/GoogleAllow'), 'HelpdeskGoogleId' => (string) $oSettings->GetConf('Helpdesk/GoogleId'), 'HelpdeskGoogleSecret' => (string) $oSettings->GetConf('Helpdesk/GoogleSecret'), 'HelpdeskTwitterAllow' => !!$oSettings->GetConf('Helpdesk/TwitterAllow'), 'HelpdeskTwitterId' => (string) $oSettings->GetConf('Helpdesk/TwitterId'), 'HelpdeskTwitterSecret' => (string) $oSettings->GetConf('Helpdesk/TwitterSecret'), 'HelpdeskFetcherType' => EHelpdeskFetcherType::NONE, 'HelpdeskAllowFetcher' => false, 'HelpdeskFetcherTimer' => 0, 'SipAllow' => !!$oSettings->GetConf('Sip/AllowSip'), 'SipAllowConfiguration' => false, 'SipRealm' => (string) $oSettings->GetConf('Sip/Realm'), 'SipWebsocketProxyUrl' => (string) $oSettings->GetConf('Sip/WebsocketProxyUrl'), 'SipOutboundProxyUrl' => (string) $oSettings->GetConf('Sip/OutboundProxyUrl'), 'SipCallerID' => (string) $oSettings->GetConf('Sip/CallerID'), 'TwilioAllow' => !!$oSettings->GetConf('Twilio/AllowTwilio'), 'TwilioAllowConfiguration' => false, 'TwilioPhoneNumber' => (string) $oSettings->GetConf('Twilio/PhoneNumber'), 'TwilioAccountSID' => (string) $oSettings->GetConf('Twilio/AccountSID'), 'TwilioAuthToken' => (string) $oSettings->GetConf('Twilio/AuthToken'), 'TwilioAppSID' => (string) $oSettings->GetConf('Twilio/AppSID'), 'Socials' => $this->getDefaultSocials(), 'CalendarNotificationEmailAccount' => '', 'InviteNotificationEmailAccount' => ''));
$this->SetLower(array('Login', 'Email', 'HelpdeskAdminEmailAccount', 'CalendarNotificationEmailAccount', 'InviteNotificationEmailAccount'));
$this->SetUpper(array('Capa'));
}
示例14: __construct
/**
* @return void
*/
public function __construct(CDomain $oDomain)
{
parent::__construct(get_class($this), 'IdUser');
$oSettings =& CApi::GetSettings();
$iSaveMail = $oSettings->GetConf('WebMail/SaveMail');
$iSaveMail = ESaveMail::Always !== $iSaveMail ? $oSettings->GetConf('WebMail/SaveMail') : ESaveMail::DefaultOn;
$this->oSubCache = null;
$this->__USE_TRIM_IN_STRINGS__ = true;
$this->SetUpper(array('Capa'));
$this->SetDefaults(array('IdUser' => 0, 'IdSubscription' => 0, 'IdHelpdeskUser' => 0, 'MailsPerPage' => $oDomain->MailsPerPage, 'ContactsPerPage' => $oDomain->ContactsPerPage, 'AutoCheckMailInterval' => $oDomain->AutoCheckMailInterval, 'CreatedTime' => 0, 'LastLogin' => 0, 'LastLoginNow' => 0, 'LoginsCount' => 0, 'DefaultSkin' => $oDomain->DefaultSkin, 'DefaultLanguage' => $oDomain->DefaultLanguage, 'DefaultEditor' => EUserHtmlEditor::Html, 'SaveMail' => $iSaveMail, 'Layout' => $oDomain->Layout, 'DefaultTimeZone' => 0, 'DefaultTimeFormat' => $oDomain->DefaultTimeFormat, 'DefaultDateFormat' => $oDomain->DefaultDateFormat, 'DefaultIncomingCharset' => CApi::GetConf('webmail.default-inc-charset', 'iso-8859-1'), 'Question1' => '', 'Question2' => '', 'Answer1' => '', 'Answer2' => '', 'TwilioNumber' => '', 'TwilioEnable' => true, 'TwilioDefaultNumber' => false, 'SipEnable' => true, 'SipImpi' => '', 'SipPassword' => '', 'Capa' => '', 'ClientTimeZone' => '', 'UseThreads' => $oDomain->UseThreads, 'SaveRepliedMessagesToCurrentFolder' => false, 'DesktopNotifications' => false, 'AllowChangeInputDirection' => false, 'EnableOpenPgp' => false, 'AllowAutosaveInDrafts' => true, 'AutosignOutgoingEmails' => false, 'AllowHelpdeskNotifications' => false, 'CustomFields' => '', 'FilesEnable' => true));
CApi::Plugin()->RunHook('api-user-construct', array(&$this));
}
示例15: __construct
/**
* @param CAccount $oAccount
*/
public function __construct(CAccount $oAccount)
{
parent::__construct(get_class($this));
$this->SetDefaults(array(
'IdAccount' => $oAccount->IdAccount,
'Enable' => true,
'Field' => EFilterFiels::From,
'Filter' => '',
'Condition' => EFilterCondition::ContainSubstring,
'Action' => EFilterAction::DoNothing,
'FolderFullName' => ''
));
}