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


PHP Sequence::getNextSequence方法代码示例

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


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

示例1: _setFirstEditorData

 /**
  * if the object is inserted into the db for the first time some fields e.g. LK, firstEditor must be set
  */
 private function _setFirstEditorData()
 {
     $this['firstEditor'] = Flat::user()->getLogicalKey();
     $this['firstEditTime'] = new base_date_model_DateTime();
     $seq = new Sequence(get_class($this));
     $this['LK'] = $seq->getNextSequence();
     $seq->save();
 }
开发者ID:kafruhs,项目名称:fws,代码行数:11,代码来源:BaseObject.php

示例2: createAdminUser

 /**
  * creates the admin user
  *
  * @param OutputDevice $od
  * @throws base_database_Exception
  */
 public function createAdminUser(OutputDevice $od)
 {
     $user = new User();
     if (!is_null($user->load(1))) {
         return;
     }
     $seq = new Sequence('User');
     $adminData['LK'] = $seq->getNextSequence();
     $adminData['firstEditor'] = 1;
     $dateTime = new base_date_model_DateTime();
     $adminData['firstEditTime'] = $dateTime->toDB();
     $adminData['editor'] = 1;
     $adminData['editTime'] = $dateTime->toDB();
     $adminData['userid'] = 'admin';
     $adminData['password'] = '9118beb30f57be4ef758e0f2e81f12c4';
     $adminData['firstName'] = 'Admin';
     $adminData['lastName'] = 'Admin';
     $adminData['email'] = 'support@faercher-it.de';
     $statement = new base_database_statement_Insert();
     $table = DB::table('user');
     $statement->setTable($table);
     foreach ($adminData as $fieldName => $value) {
         $statement->setColumnValue($table->getColumn($fieldName), DB::term($value));
     }
     $dbObj = base_database_connection_Mysql::get();
     $dbObj->beginTransaction();
     $seq->save();
     $statement->insertDatabase();
     $dbObj->endTransaction();
     base_install_Message::printOut('----- Admin User created -----', $od);
 }
开发者ID:kafruhs,项目名称:fws,代码行数:37,代码来源:Manager.php


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