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


PHP PearDatabase::startTransaction方法代码示例

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


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

示例1: saveentity

 /** Function to save the user information into the database
  * @param $module -- module name:: Type varchar
  *
  */
 function saveentity($module)
 {
     global $current_user;
     //$adb added by raju for mass mailing
     $insertion_mode = $this->mode;
     if (empty($this->column_fields['time_zone'])) {
         $dbDefaultTimeZone = DateTimeField::getDBTimeZone();
         $this->column_fields['time_zone'] = $dbDefaultTimeZone;
         $this->time_zone = $dbDefaultTimeZone;
     }
     if (empty($this->column_fields['currency_id'])) {
         $this->column_fields['currency_id'] = CurrencyField::getDBCurrencyId();
     }
     if (empty($this->column_fields['date_format'])) {
         $this->column_fields['date_format'] = 'yyyy-mm-dd';
     }
     $this->db->println("TRANS saveentity starts {$module}");
     $this->db->startTransaction();
     foreach ($this->tab_name as $table_name) {
         if ($table_name == 'vtiger_attachments') {
             $this->insertIntoAttachment($this->id, $module);
         } else {
             $this->insertIntoEntityTable($table_name, $module);
         }
     }
     require_once 'modules/Users/CreateUserPrivilegeFile.php';
     createUserPrivilegesfile($this->id);
     unset($_SESSION['next_reminder_interval']);
     unset($_SESSION['next_reminder_time']);
     if ($insertion_mode != 'edit') {
         $this->createAccessKey();
     }
     $this->db->completeTransaction();
     $this->db->println("TRANS saveentity ends");
 }
开发者ID:hbsman,项目名称:vtigercrm-5.3.0-ja,代码行数:39,代码来源:Users.php

示例2: saveentity

 /** Function to save the user information into the database
  * @param $module -- module name:: Type varchar
  *
  */
 function saveentity($module)
 {
     global $current_user;
     //$adb added by raju for mass mailing
     $insertion_mode = $this->mode;
     if (empty($this->column_fields['time_zone'])) {
         $dbDefaultTimeZone = DateTimeField::getDBTimeZone();
         $this->column_fields['time_zone'] = $dbDefaultTimeZone;
         $this->time_zone = $dbDefaultTimeZone;
     }
     if (empty($this->column_fields['currency_id'])) {
         $this->column_fields['currency_id'] = CurrencyField::getDBCurrencyId();
     }
     if (empty($this->column_fields['date_format'])) {
         $this->column_fields['date_format'] = 'yyyy-mm-dd';
     }
     if (empty($this->column_fields['start_hour'])) {
         $this->column_fields['start_hour'] = '08:00';
     }
     if (empty($this->column_fields['dayoftheweek'])) {
         $this->column_fields['dayoftheweek'] = 'Monday';
     }
     if (empty($this->column_fields['callduration'])) {
         $this->column_fields['callduration'] = 5;
     }
     if (empty($this->column_fields['othereventduration'])) {
         $this->column_fields['othereventduration'] = 5;
     }
     if (empty($this->column_fields['hour_format'])) {
         $this->column_fields['hour_format'] = 24;
     }
     if (empty($this->column_fields['activity_view'])) {
         $this->column_fields['activity_view'] = 'This Month';
     }
     if (empty($this->column_fields['calendarsharedtype'])) {
         $this->column_fields['calendarsharedtype'] = 'public';
     }
     if (empty($this->column_fields['default_record_view'])) {
         $this->column_fields['default_record_view'] = 'Summary';
     }
     if (empty($this->column_fields['status'])) {
         $this->column_fields['status'] = 'Active';
     }
     if (empty($this->column_fields['currency_decimal_separator']) && $this->column_fields['currency_decimal_separator'] != ' ') {
         $this->column_fields['currency_decimal_separator'] = '.';
     }
     if (empty($this->column_fields['currency_grouping_separator']) && $this->column_fields['currency_grouping_separator'] != ' ') {
         $this->column_fields['currency_grouping_separator'] = ' ';
     }
     $this->db->println("TRANS saveentity starts {$module}");
     $this->db->startTransaction();
     foreach ($this->tab_name as $table_name) {
         if ($table_name == 'vtiger_attachments') {
             $this->insertIntoAttachment($this->id, $module);
         } else {
             $this->insertIntoEntityTable($table_name, $module);
         }
     }
     if (Settings_Roles_Record_Model::getInstanceById($this->column_fields['roleid']) == null) {
         $roleid = Settings_Roles_Record_Model::getInstanceByName($this->column_fields['roleid']);
         if ($roleid) {
             $this->column_fields['roleid'] = $roleid->getId();
         } else {
             $roles = Settings_Roles_Record_Model::getAll();
             $this->column_fields['roleid'] = key($roles);
         }
     }
     require_once 'modules/Users/CreateUserPrivilegeFile.php';
     createUserPrivilegesfile($this->id);
     unset($_SESSION['next_reminder_interval']);
     unset($_SESSION['next_reminder_time']);
     if ($insertion_mode != 'edit') {
         $this->createAccessKey();
     }
     $this->db->completeTransaction();
     $this->db->println("TRANS saveentity ends");
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:81,代码来源:Users.php

示例3: saveentity

    /** Function to save the user information into the database
     * @param $module -- module name:: Type varchar
     *
     */
    function saveentity($module) {
        global $current_user;//$adb added by raju for mass mailing
        $insertion_mode = $this->mode;
        if(empty($this->column_fields['time_zone'])) {
            $dbDefaultTimeZone = DateTimeField::getDBTimeZone();
            $this->column_fields['time_zone'] = $dbDefaultTimeZone;
            $this->time_zone = $dbDefaultTimeZone;
        }
        if(empty($this->column_fields['currency_id'])) {
            $this->column_fields['currency_id'] = CurrencyField::getDBCurrencyId();
        }
        if(empty($this->column_fields['date_format'])) {
            $this->column_fields['date_format'] = 'yyyy-mm-dd';
        }

		if(empty($this->column_fields['start_hour'])) {
            $this->column_fields['start_hour'] = '09:00';
        }

		if(empty($this->column_fields['dayoftheweek'])) {
            //SalesPlatform.ru begin
            $this->column_fields['dayoftheweek'] = 'Monday';        
            /*vtiger commented code        
            $this->column_fields['dayoftheweek'] = 'Sunday';
            */
            //SalesPlatform.ru end 
        }

		if(empty($this->column_fields['callduration'])) {
            $this->column_fields['callduration'] = 5;
        }

		if(empty($this->column_fields['othereventduration'])) {
            $this->column_fields['othereventduration'] = 5;
        }

		if(empty($this->column_fields['hour_format'])) {
            $this->column_fields['hour_format'] = 12;
        }

		if(empty($this->column_fields['activity_view'])) {
            $this->column_fields['activity_view'] = 'Today';
        }

		if(empty($this->column_fields['calendarsharedtype'])) {
            $this->column_fields['calendarsharedtype'] = 'public';
        }

		if(empty($this->column_fields['default_record_view'])) {
            $this->column_fields['default_record_view'] = 'Summary';
        }

		if(empty($this->column_fields['status'])) {
			$this->column_fields['status'] = 'Active';
		}

		if(empty($this->column_fields['currency_decimal_separator'])) {
                        //SalesPlatform.ru begin
                        $this->column_fields['currency_decimal_separator'] = ",";
                        /*vtiger commented code  
			$this->column_fields['currency_decimal_separator'] = '.';
                        */
                        //SalesPlatform.ru end 
		}

                //SalesPlatform.ru begin
                if(empty($this->column_fields["currency_grouping_pattern"])) {
                    $this->column_fields["currency_grouping_pattern"] = '123456789';
                }
                //SalesPlatform.ru end 
                
		if(empty($this->column_fields['currency_grouping_separator'])) {
            //SalesPlatform.ru begin
			$this->column_fields['currency_grouping_separator'] = '\'';
            //$this->column_fields['currency_grouping_separator'] = ',';
            //SalesPlatform.ru end 
		}

        $this->db->println("TRANS saveentity starts $module");
        $this->db->startTransaction();
        foreach($this->tab_name as $table_name) {
            if($table_name == 'vtiger_attachments') {
                $this->insertIntoAttachment($this->id,$module);
            }
            else {
                $this->insertIntoEntityTable($table_name, $module);
            }
        }
        require_once('modules/Users/CreateUserPrivilegeFile.php');
        createUserPrivilegesfile($this->id);
        unset($_SESSION['next_reminder_interval']);
        unset($_SESSION['next_reminder_time']);
        if($insertion_mode != 'edit') {
            $this->createAccessKey();
        }
        $this->db->completeTransaction();
//.........这里部分代码省略.........
开发者ID:Wasage,项目名称:werpa,代码行数:101,代码来源:Users.php


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