当前位置: 首页>>代码示例>>PHP>>正文


PHP Role::Load方法代码示例

本文整理汇总了PHP中Role::Load方法的典型用法代码示例。如果您正苦于以下问题:PHP Role::Load方法的具体用法?PHP Role::Load怎么用?PHP Role::Load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Role的用法示例。


在下文中一共展示了Role::Load方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: role

 public function role()
 {
     $col_name = "association_role_id";
     $role = null;
     if (isset($this->{$col_name}) && is_numeric($this->{$col_name})) {
         $role_id = $this->{$col_name};
         require_once 'class.mt_role.php';
         $role = new Role();
         $role->Load("role_id = {$role_id}");
     }
     return $role;
 }
开发者ID:OCMO,项目名称:movabletype,代码行数:12,代码来源:class.mt_association.php

示例2: SetupRole

 protected function SetupRole()
 {
     // Lookup Object PK information from Query String (if applicable)
     // Set mode to Edit or New depending on what's found
     $intRoleId = QApplication::QueryString('intRoleId');
     if ($intRoleId) {
         $this->objRole = Role::Load($intRoleId);
         if (!$this->objRole) {
             throw new Exception('Could not find a Role object with PK arguments: ' . $intRoleId);
         }
         $this->strTitleVerb = QApplication::Translate('Edit');
         $this->blnEditMode = true;
     } else {
         $this->objRole = new Role();
         $this->strTitleVerb = QApplication::Translate('Create');
         $this->blnEditMode = false;
     }
 }
开发者ID:brustj,项目名称:tracmor,代码行数:18,代码来源:RoleEditFormBase.class.php

示例3: __get

 /**
  * Override method to perform a property "Get"
  * This will get the value of $strName
  *
  * @param string $strName Name of the property to get
  * @return mixed
  */
 public function __get($strName)
 {
     switch ($strName) {
         ///////////////////
         // Member Variables
         ///////////////////
         case 'RoleEntityBuiltInId':
             // Gets the value for intRoleEntityBuiltInId (Read-Only PK)
             // @return integer
             return $this->intRoleEntityBuiltInId;
         case 'RoleId':
             // Gets the value for intRoleId (Not Null)
             // @return integer
             return $this->intRoleId;
         case 'EntityQtypeId':
             // Gets the value for intEntityQtypeId (Not Null)
             // @return integer
             return $this->intEntityQtypeId;
         case 'AuthorizationId':
             // Gets the value for intAuthorizationId (Not Null)
             // @return integer
             return $this->intAuthorizationId;
         case 'AuthorizedFlag':
             // Gets the value for blnAuthorizedFlag (Not Null)
             // @return boolean
             return $this->blnAuthorizedFlag;
         case 'CreatedBy':
             // Gets the value for intCreatedBy
             // @return integer
             return $this->intCreatedBy;
         case 'CreationDate':
             // Gets the value for dttCreationDate
             // @return QDateTime
             return $this->dttCreationDate;
         case 'ModifiedBy':
             // Gets the value for intModifiedBy
             // @return integer
             return $this->intModifiedBy;
         case 'ModifiedDate':
             // Gets the value for strModifiedDate (Read-Only Timestamp)
             // @return string
             return $this->strModifiedDate;
             ///////////////////
             // Member Objects
             ///////////////////
         ///////////////////
         // Member Objects
         ///////////////////
         case 'Role':
             // Gets the value for the Role object referenced by intRoleId (Not Null)
             // @return Role
             try {
                 if (!$this->objRole && !is_null($this->intRoleId)) {
                     $this->objRole = Role::Load($this->intRoleId);
                 }
                 return $this->objRole;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'Authorization':
             // Gets the value for the Authorization object referenced by intAuthorizationId (Not Null)
             // @return Authorization
             try {
                 if (!$this->objAuthorization && !is_null($this->intAuthorizationId)) {
                     $this->objAuthorization = Authorization::Load($this->intAuthorizationId);
                 }
                 return $this->objAuthorization;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'CreatedByObject':
             // Gets the value for the UserAccount object referenced by intCreatedBy
             // @return UserAccount
             try {
                 if (!$this->objCreatedByObject && !is_null($this->intCreatedBy)) {
                     $this->objCreatedByObject = UserAccount::Load($this->intCreatedBy);
                 }
                 return $this->objCreatedByObject;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'ModifiedByObject':
             // Gets the value for the UserAccount object referenced by intModifiedBy
             // @return UserAccount
             try {
                 if (!$this->objModifiedByObject && !is_null($this->intModifiedBy)) {
                     $this->objModifiedByObject = UserAccount::Load($this->intModifiedBy);
                 }
                 return $this->objModifiedByObject;
             } catch (QCallerException $objExc) {
//.........这里部分代码省略.........
开发者ID:proxymoron,项目名称:tracmor,代码行数:101,代码来源:RoleEntityQtypeBuiltInAuthorizationGen.class.php

示例4: Reload

 /**
  * Reload this Role from the database.
  * @return void
  */
 public function Reload()
 {
     // Make sure we are actually Restored from the database
     if (!$this->__blnRestored) {
         throw new QCallerException('Cannot call Reload() on a new, unsaved Role object.');
     }
     // Reload the Object
     $objReloaded = Role::Load($this->intRoleId);
     // Update $this's local variables to match
     $this->strShortDescription = $objReloaded->strShortDescription;
     $this->strLongDescription = $objReloaded->strLongDescription;
     $this->CreatedBy = $objReloaded->CreatedBy;
     $this->dttCreationDate = $objReloaded->dttCreationDate;
     $this->ModifiedBy = $objReloaded->ModifiedBy;
     $this->strModifiedDate = $objReloaded->strModifiedDate;
 }
开发者ID:proxymoron,项目名称:tracmor,代码行数:20,代码来源:RoleGen.class.php

示例5: __get

 /**
  * Override method to perform a property "Get"
  * This will get the value of $strName
  *
  * @param string $strName Name of the property to get
  * @return mixed
  */
 public function __get($strName)
 {
     switch ($strName) {
         ///////////////////
         // Member Variables
         ///////////////////
         case 'RoleModuleId':
             /**
              * Gets the value for intRoleModuleId (Read-Only PK)
              * @return integer
              */
             return $this->intRoleModuleId;
         case 'RoleId':
             /**
              * Gets the value for intRoleId (Not Null)
              * @return integer
              */
             return $this->intRoleId;
         case 'ModuleId':
             /**
              * Gets the value for intModuleId (Not Null)
              * @return integer
              */
             return $this->intModuleId;
         case 'AccessFlag':
             /**
              * Gets the value for blnAccessFlag (Not Null)
              * @return boolean
              */
             return $this->blnAccessFlag;
         case 'CreatedBy':
             /**
              * Gets the value for intCreatedBy 
              * @return integer
              */
             return $this->intCreatedBy;
         case 'CreationDate':
             /**
              * Gets the value for dttCreationDate 
              * @return QDateTime
              */
             return $this->dttCreationDate;
         case 'ModifiedBy':
             /**
              * Gets the value for intModifiedBy 
              * @return integer
              */
             return $this->intModifiedBy;
         case 'ModifiedDate':
             /**
              * Gets the value for strModifiedDate (Read-Only Timestamp)
              * @return string
              */
             return $this->strModifiedDate;
             ///////////////////
             // Member Objects
             ///////////////////
         ///////////////////
         // Member Objects
         ///////////////////
         case 'Role':
             /**
              * Gets the value for the Role object referenced by intRoleId (Not Null)
              * @return Role
              */
             try {
                 if (!$this->objRole && !is_null($this->intRoleId)) {
                     $this->objRole = Role::Load($this->intRoleId);
                 }
                 return $this->objRole;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'Module':
             /**
              * Gets the value for the Module object referenced by intModuleId (Not Null)
              * @return Module
              */
             try {
                 if (!$this->objModule && !is_null($this->intModuleId)) {
                     $this->objModule = Module::Load($this->intModuleId);
                 }
                 return $this->objModule;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'CreatedByObject':
             /**
              * Gets the value for the UserAccount object referenced by intCreatedBy 
              * @return UserAccount
              */
//.........这里部分代码省略.........
开发者ID:heshuai64,项目名称:einv2,代码行数:101,代码来源:RoleModuleGen.class.php

示例6: btnEdit_Click

 public function btnEdit_Click($strFormId, $strControlId, $strParameter)
 {
     $strParameterArray = explode(',', $strParameter);
     $objRole = Role::Load($strParameterArray[0]);
     $objEditPanel = new RoleEditPanel($this, $this->strCloseEditPanelMethod, $objRole);
     $strMethodName = $this->strSetEditPanelMethod;
     $this->objForm->{$strMethodName}($objEditPanel);
 }
开发者ID:heshuai64,项目名称:einv2,代码行数:8,代码来源:RoleListPanelBase.class.php

示例7: Create

 /**
  * Static Helper Method to Create using PK arguments
  * You must pass in the PK arguments on an object to load, or leave it blank to create a new one.
  * If you want to load via QueryString or PathInfo, use the CreateFromQueryString or CreateFromPathInfo
  * static helper methods.  Finally, specify a CreateType to define whether or not we are only allowed to 
  * edit, or if we are also allowed to create a new one, etc.
  * 
  * @param mixed $objParentObject QForm or QPanel which will be using this RoleMetaControl
  * @param integer $intRoleId primary key value
  * @param QMetaControlCreateType $intCreateType rules governing Role object creation - defaults to CreateOrEdit
  * @return RoleMetaControl
  */
 public static function Create($objParentObject, $intRoleId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit)
 {
     // Attempt to Load from PK Arguments
     if (strlen($intRoleId)) {
         $objRole = Role::Load($intRoleId);
         // Role was found -- return it!
         if ($objRole) {
             return new RoleMetaControl($objParentObject, $objRole);
         } else {
             if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound) {
                 throw new QCallerException('Could not find a Role object with PK arguments: ' . $intRoleId);
             }
         }
         // If EditOnly is specified, throw an exception
     } else {
         if ($intCreateType == QMetaControlCreateType::EditOnly) {
             throw new QCallerException('No PK arguments specified');
         }
     }
     // If we are here, then we need to create a new record
     return new RoleMetaControl($objParentObject, new Role());
 }
开发者ID:proxymoron,项目名称:tracmor,代码行数:34,代码来源:RoleMetaControlGen.class.php

示例8: __get

 /**
  * Override method to perform a property "Get"
  * This will get the value of $strName
  *
  * @param string $strName Name of the property to get
  * @return mixed
  */
 public function __get($strName)
 {
     switch ($strName) {
         ///////////////////
         // Member Variables
         ///////////////////
         case 'UserAccountId':
             // Gets the value for intUserAccountId (Read-Only PK)
             // @return integer
             return $this->intUserAccountId;
         case 'FirstName':
             // Gets the value for strFirstName (Not Null)
             // @return string
             return $this->strFirstName;
         case 'LastName':
             // Gets the value for strLastName (Not Null)
             // @return string
             return $this->strLastName;
         case 'Username':
             // Gets the value for strUsername (Unique)
             // @return string
             return $this->strUsername;
         case 'PasswordHash':
             // Gets the value for strPasswordHash (Not Null)
             // @return string
             return $this->strPasswordHash;
         case 'EmailAddress':
             // Gets the value for strEmailAddress
             // @return string
             return $this->strEmailAddress;
         case 'ActiveFlag':
             // Gets the value for blnActiveFlag (Not Null)
             // @return boolean
             return $this->blnActiveFlag;
         case 'AdminFlag':
             // Gets the value for blnAdminFlag (Not Null)
             // @return boolean
             return $this->blnAdminFlag;
         case 'PortableAccessFlag':
             // Gets the value for blnPortableAccessFlag
             // @return boolean
             return $this->blnPortableAccessFlag;
         case 'PortableUserPin':
             // Gets the value for intPortableUserPin
             // @return integer
             return $this->intPortableUserPin;
         case 'RoleId':
             // Gets the value for intRoleId (Not Null)
             // @return integer
             return $this->intRoleId;
         case 'CreatedBy':
             // Gets the value for intCreatedBy
             // @return integer
             return $this->intCreatedBy;
         case 'CreationDate':
             // Gets the value for dttCreationDate
             // @return QDateTime
             return $this->dttCreationDate;
         case 'ModifiedBy':
             // Gets the value for intModifiedBy
             // @return integer
             return $this->intModifiedBy;
         case 'ModifiedDate':
             // Gets the value for strModifiedDate (Read-Only Timestamp)
             // @return string
             return $this->strModifiedDate;
             ///////////////////
             // Member Objects
             ///////////////////
         ///////////////////
         // Member Objects
         ///////////////////
         case 'Role':
             // Gets the value for the Role object referenced by intRoleId (Not Null)
             // @return Role
             try {
                 if (!$this->objRole && !is_null($this->intRoleId)) {
                     $this->objRole = Role::Load($this->intRoleId);
                 }
                 return $this->objRole;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'CreatedByObject':
             // Gets the value for the UserAccount object referenced by intCreatedBy
             // @return UserAccount
             try {
                 if (!$this->objCreatedByObject && !is_null($this->intCreatedBy)) {
                     $this->objCreatedByObject = UserAccount::Load($this->intCreatedBy);
                 }
                 return $this->objCreatedByObject;
             } catch (QCallerException $objExc) {
//.........这里部分代码省略.........
开发者ID:jdellinger,项目名称:tracmor,代码行数:101,代码来源:UserAccountGen.class.php


注:本文中的Role::Load方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。