Server IP : 103.233.192.212 / Your IP : 3.148.197.73 Web Server : Apache/2 System : Linux sv1.inde.co.th 3.10.0-1160.36.2.el7.x86_64 #1 SMP Wed Jul 21 11:57:15 UTC 2021 x86_64 User : sumpatuan ( 1058) PHP Version : 5.5.38 Disable Function : symlink,shell_exec,exec,proc_close,proc_open,popen,system,dl,putenv,passthru,escapeshellarg,escapeshellcmd,pcntl_exec,proc_get_status,proc_nice,proc_terminate,pclose,ini_alter,virtual,openlog,ini_restore MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/sumpatuan/public_html/backup/framework/db/schema/mysql/ |
Upload File : |
<?php /** * CMysqlCommandBuilder class file. * * @author Carsten Brandt <mail@cebe.cc> * @link http://www.yiiframework.com/ * @copyright 2008-2013 Yii Software LLC * @license http://www.yiiframework.com/license/ */ /** * CMysqlCommandBuilder provides basic methods to create query commands for tables. * * @author Carsten Brandt <mail@cebe.cc> * @package system.db.schema.mysql * @since 1.1.13 */ class CMysqlCommandBuilder extends CDbCommandBuilder { /** * Alters the SQL to apply JOIN clause. * This method handles the mysql specific syntax where JOIN has to come before SET in UPDATE statement * and for DELETE where JOIN has to be after FROM part. * @param string $sql the SQL statement to be altered * @param string $join the JOIN clause (starting with join type, such as INNER JOIN) * @return string the altered SQL statement */ public function applyJoin($sql,$join) { if($join=='') return $sql; if(strpos($sql,'UPDATE')===0 && ($pos=strpos($sql,'SET'))!==false) return substr($sql,0,$pos).$join.' '.substr($sql,$pos); elseif(strpos($sql,'DELETE FROM ')===0) { $tableName=substr($sql,12); return "DELETE {$tableName} FROM {$tableName} ".$join; } else return $sql.' '.$join; } }