当前位置: 首页>>代码示例>>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;未经允许,请勿转载。