diff --git a/FormDin5/lib/widget/FormDin5/helpers/SqlHelper.class.php b/FormDin5/lib/widget/FormDin5/helpers/SqlHelper.class.php index dd56046f..40892e8f 100644 --- a/FormDin5/lib/widget/FormDin5/helpers/SqlHelper.class.php +++ b/FormDin5/lib/widget/FormDin5/helpers/SqlHelper.class.php @@ -134,9 +134,9 @@ public static function attributeIssetOrNotZero($whereGrid return $retorno; } //---------------------------------------- - public static function transformValidateString( $string ) - { - $dbms = SqlHelper::getDbms(); + public static function transformValidateString( $string , $dbms=null) + { + $dbms = empty($dbms)?SqlHelper::getDbms():$dbms; if ( $dbms == TFormDinPdoConnection::DBMS_MYSQL ) { //$string = addslashes($string); //$patterns = '/(%)/'; @@ -160,9 +160,9 @@ public static function transformValidateString( $string ) * @param string $string * @return string` */ - public static function explodeTextString( $string ) + public static function explodeTextString( $string, $dbms=null ) { - $dbms = SqlHelper::getDbms(); + $dbms = empty($dbms)?SqlHelper::getDbms():$dbms; $dataBaseWithLike = ($dbms == TFormDinPdoConnection::DBMS_MYSQL) || ($dbms == TFormDinPdoConnection::DBMS_POSTGRES) || ($dbms == TFormDinPdoConnection::DBMS_SQLITE) @@ -338,6 +338,7 @@ public static function getSqlTypeIn( $stringWhere * @param string $type 4: Type of clauses * @param boolean $testZero 5: * @param string $connector 6: Connector self::SQL_CONNECTOR_AND or self::SQL_CONNECTOR_OR + * @param string $dbms 7: Type of Database management system, see const of TFormDinPdoConnection * @return string */ public static function getAtributeWhereGridParameters( $stringWhere @@ -346,12 +347,13 @@ public static function getAtributeWhereGridParameters( $stringWhere , $type , $testZero=null , $connector=null + , $dbms=null ) { $testZero = empty($testZero)?true:$testZero; $connector = empty($connector)?self::SQL_CONNECTOR_AND:$connector; if( ArrayHelper::has($attribute, $arrayWhereGrid) ){ - $dbms = SqlHelper::getDbms(); + $dbms = empty($dbms)?SqlHelper::getDbms():$dbms; if( empty($dbms) ){ throw new InvalidArgumentException(TFormDinMessage::ERROR_SQL_NULL_DBMA); }