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


PHP ConnectionFactory::CreateEngCommandImp方法代碼示例

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


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

示例1: GetUserGrants

 /**
  * @param int $userId
  * @param Captions $captions
  * @return array
  */
 public function GetUserGrants($userId, Captions $captions)
 {
     $queryBuilder = new SelectCommand($this->connectionFactory->CreateEngCommandImp());
     $queryBuilder->AddField($this->usersTable, $this->users_UserId, FieldType::Number, 'users_user_id');
     $queryBuilder->AddField($this->usersTable, $this->users_UserName, FieldType::String, 'users_user_name');
     $queryBuilder->AddField($this->userPermsTable, $this->userPerms_UserId, FieldType::Number, 'userperms_user_id');
     $queryBuilder->AddField($this->userPermsTable, $this->userPerms_PageName, FieldType::String, 'userperms_pagename');
     $queryBuilder->AddField($this->userPermsTable, $this->userPerms_Grant, FieldType::String, 'userperms_grant');
     $queryBuilder->SetSourceTableName($this->userPermsTable);
     $queryBuilder->AddJoin(JoinKind::LeftOuter, $this->usersTable, 'userperms_user_id', $this->users_UserId);
     $queryBuilder->AddFieldFilter('userperms_user_id', new FieldFilter($userId, '='));
     $dataset = new QueryDataset($this->connectionFactory, $this->connectionOptions, $queryBuilder->GetSQL(), array(), array(), array(), 'user_grants');
     $dataset->AddField(new StringField('userperms_grant'), false);
     $dataset->AddField(new StringField('userperms_pagename'), false);
     $dataset->Open();
     $pages = array();
     $pages[''] = array('name' => '', 'caption' => $captions->GetMessageString('Application'), 'selectGrant' => false, 'updateGrant' => false, 'insertGrant' => false, 'deleteGrant' => false, 'adminGrant' => false);
     foreach ($this->tableCaptions as $name => $caption) {
         $pages[$name] = array('name' => $name, 'caption' => $captions->RenderText($caption), 'selectGrant' => false, 'updateGrant' => false, 'insertGrant' => false, 'deleteGrant' => false, 'adminGrant' => false);
     }
     while ($dataset->Next()) {
         $grant = $dataset->GetFieldValueByName('userperms_grant');
         $pageName = $dataset->GetFieldValueByName('userperms_pagename');
         if (isset($pages[$pageName])) {
             $pages[$pageName]['selectGrant'] = $pages[$pageName]['selectGrant'] || StringUtils::SameText($grant, 'select');
             $pages[$pageName]['updateGrant'] = $pages[$pageName]['updateGrant'] || StringUtils::SameText($grant, 'update');
             $pages[$pageName]['insertGrant'] = $pages[$pageName]['insertGrant'] || StringUtils::SameText($grant, 'insert');
             $pages[$pageName]['deleteGrant'] = $pages[$pageName]['deleteGrant'] || StringUtils::SameText($grant, 'delete');
             $pages[$pageName]['adminGrant'] = $pages[$pageName]['adminGrant'] || StringUtils::SameText($grant, 'admin');
         }
     }
     $dataset->Close();
     return array_values($pages);
 }
開發者ID:outsourcinggithub,項目名稱:outsourcing,代碼行數:39,代碼來源:table_based_user_grants_manager.php

示例2: GetCommandImp

 /**
  * @return EngCommandImp
  */
 public function GetCommandImp()
 {
     if (!isset($this->commandImp)) {
         $this->commandImp = $this->connectionFactory->CreateEngCommandImp();
     }
     return $this->commandImp;
 }
開發者ID:martinw0102,項目名稱:ProjetSyst,代碼行數:10,代碼來源:dataset.php


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