當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DBObjectSearch::FromOQL_AllData方法代碼示例

本文整理匯總了PHP中DBObjectSearch::FromOQL_AllData方法的典型用法代碼示例。如果您正苦於以下問題:PHP DBObjectSearch::FromOQL_AllData方法的具體用法?PHP DBObjectSearch::FromOQL_AllData怎麽用?PHP DBObjectSearch::FromOQL_AllData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DBObjectSearch的用法示例。


在下文中一共展示了DBObjectSearch::FromOQL_AllData方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: GetClassStimulusGrant

 public function GetClassStimulusGrant($iProfile, $sClass, $sStimulusCode)
 {
     if (isset($this->m_aClassStimulusGrants[$iProfile][$sClass][$sStimulusCode])) {
         return $this->m_aClassStimulusGrants[$iProfile][$sClass][$sStimulusCode];
     }
     // Get the permission for this profile/class/stimulus
     $oSearch = DBObjectSearch::FromOQL_AllData("SELECT URP_StimulusGrant WHERE class = :class AND stimulus = :stimulus AND profileid = :profile AND permission = 'yes'");
     $oSet = new DBObjectSet($oSearch, array(), array('class' => $sClass, 'stimulus' => $sStimulusCode, 'profile' => $iProfile));
     if ($oSet->Count() >= 1) {
         $oGrantRecord = $oSet->Fetch();
     } else {
         $oGrantRecord = null;
     }
     $this->m_aClassStimulusGrants[$iProfile][$sClass][$sStimulusCode] = $oGrantRecord;
     return $oGrantRecord;
 }
開發者ID:leandroborgeseng,項目名稱:bhtm,代碼行數:16,代碼來源:userrightsprojection.class.inc.php

示例2: LoadCache

 public function LoadCache()
 {
     if (!is_null($this->m_aProfiles)) {
         return;
     }
     // Could be loaded in a shared memory (?)
     $oKPI = new ExecutionKPI();
     if (self::HasSharing()) {
         SharedObject::InitSharedClassProperties();
     }
     $oProfileSet = new DBObjectSet(DBObjectSearch::FromOQL_AllData("SELECT URP_Profiles"));
     $this->m_aProfiles = array();
     while ($oProfile = $oProfileSet->Fetch()) {
         $this->m_aProfiles[$oProfile->GetKey()] = $oProfile;
     }
     $oKPI->ComputeAndReport('Load of user management cache (excepted Action Grants)');
     /*
     		echo "<pre>\n";
     		print_r($this->m_aProfiles);
     		print_r($this->m_aUserProfiles);
     		print_r($this->m_aUserOrgs);
     		echo "</pre>\n";
     exit;
     */
     return true;
 }
開發者ID:kira8565,項目名稱:ITOP203-ZHCN,代碼行數:26,代碼來源:userrightsprofile.class.inc.php

示例3: DoCheckToWrite

 public function DoCheckToWrite()
 {
     parent::DoCheckToWrite();
     // Note: This MUST be factorized later: declare unique keys (set of columns) in the data model
     $aChanges = $this->ListChanges();
     if (array_key_exists('login', $aChanges)) {
         if (strcasecmp($this->Get('login'), $this->GetOriginal('login')) !== 0) {
             $sNewLogin = $aChanges['login'];
             $oSearch = DBObjectSearch::FromOQL_AllData("SELECT User WHERE login = :newlogin");
             if (!$this->IsNew()) {
                 $oSearch->AddCondition('id', $this->GetKey(), '!=');
             }
             $oSet = new DBObjectSet($oSearch, array(), array('newlogin' => $sNewLogin));
             if ($oSet->Count() > 0) {
                 $this->m_aCheckIssues[] = Dict::Format('Class:User/Error:LoginMustBeUnique', $sNewLogin);
             }
         }
     }
     // Check that this user has at least one profile assigned
     $oSet = $this->Get('profile_list');
     if ($oSet->Count() == 0) {
         $this->m_aCheckIssues[] = Dict::Format('Class:User/Error:AtLeastOneProfileIsNeeded');
     }
 }
開發者ID:leandroborgeseng,項目名稱:bhtm,代碼行數:24,代碼來源:userrights.class.inc.php

示例4: LoadValues

 protected function LoadValues($aArgs, $sContains = '')
 {
     $this->m_sContains = $sContains;
     $this->m_aValues = array();
     if ($this->m_bAllowAllData) {
         $oFilter = DBObjectSearch::FromOQL_AllData($this->m_sFilterExpr);
     } else {
         $oFilter = DBObjectSearch::FromOQL($this->m_sFilterExpr);
     }
     if (!$oFilter) {
         return false;
     }
     foreach ($this->m_aExtraConditions as $oExtraFilter) {
         $oFilter = $oFilter->Intersect($oExtraFilter);
     }
     foreach ($this->m_aModifierProperties as $sPluginClass => $aProperties) {
         foreach ($aProperties as $sProperty => $value) {
             $oFilter->SetModifierProperty($sPluginClass, $sProperty, $value);
         }
     }
     $oValueExpr = new ScalarExpression('%' . $sContains . '%');
     $oNameExpr = new FieldExpression('friendlyname', $oFilter->GetClassAlias());
     $oNewCondition = new BinaryExpression($oNameExpr, 'LIKE', $oValueExpr);
     $oFilter->AddConditionExpression($oNewCondition);
     $oObjects = new DBObjectSet($oFilter, $this->m_aOrderBy, $aArgs);
     while ($oObject = $oObjects->Fetch()) {
         if (empty($this->m_sValueAttCode)) {
             $this->m_aValues[$oObject->GetKey()] = $oObject->GetName();
         } else {
             $this->m_aValues[$oObject->GetKey()] = $oObject->Get($this->m_sValueAttCode);
         }
     }
     return true;
 }
開發者ID:leandroborgeseng,項目名稱:bhtm,代碼行數:34,代碼來源:valuesetdef.class.inc.php

示例5: GetUserActionGrant

 protected function GetUserActionGrant($oUser, $sClass, $iActionCode)
 {
     $this->LoadCache();
     // load and cache permissions for the current user on the given class
     //
     $iUser = $oUser->GetKey();
     $aTest = @$this->m_aObjectActionGrants[$iUser][$sClass][$iActionCode];
     if (is_array($aTest)) {
         return $aTest;
     }
     $sAction = self::$m_aActionCodes[$iActionCode];
     $iPermission = UR_ALLOWED_NO;
     $aAttributes = array();
     foreach ($this->GetUserProfiles($iUser) as $iProfile => $oProfile) {
         $iGrant = $this->GetProfileActionGrant($iProfile, $sClass, $sAction);
         if (is_null($iGrant) || !$iGrant) {
             continue;
             // loop to the next profile
         } else {
             $iPermission = UR_ALLOWED_YES;
             // update the list of attributes with those allowed for this profile
             //
             $oSearch = DBObjectSearch::FromOQL_AllData("SELECT URP_AttributeGrant WHERE actiongrantid = :actiongrantid");
             $oSet = new DBObjectSet($oSearch, array(), array('actiongrantid' => $iGrant));
             $aProfileAttributes = $oSet->GetColumnAsArray('attcode', false);
             if (count($aProfileAttributes) == 0) {
                 $aAllAttributes = array_keys(MetaModel::ListAttributeDefs($sClass));
                 $aAttributes = array_merge($aAttributes, $aAllAttributes);
             } else {
                 $aAttributes = array_merge($aAttributes, $aProfileAttributes);
             }
         }
     }
     $aRes = array('permission' => $iPermission, 'attributes' => $aAttributes);
     $this->m_aObjectActionGrants[$iUser][$sClass][$iActionCode] = $aRes;
     return $aRes;
 }
開發者ID:kira8565,項目名稱:ITOP203-ZHCN,代碼行數:37,代碼來源:userrightsprofile.db.class.inc.php


注:本文中的DBObjectSearch::FromOQL_AllData方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。