This repository has been archived on 2024-12-01. You can view files and clone it, but cannot push or open issues or pull requests.
factuges_web/yii/framework/db/schema/mysql/CMysqlCommandBuilder.php
david e93adbdd4e - Importación inicial
- Registro, activación y entrada de usuarios


git-svn-id: https://192.168.0.254/svn/Rodax.factuges_web/trunk@2 e455b18d-f7fe-5245-9c43-e2c35af70a32
2013-06-13 16:04:48 +00:00

37 lines
1.0 KiB
PHP

<?php
/**
* CMysqlCommandBuilder class file.
*
* @author Carsten Brandt <mail@cebe.cc>
* @link http://www.yiiframework.com/
* @copyright Copyright &copy; 2008-2011 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
* @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);
else
return $sql.' '.$join;
}
}