Skip to content

Commit

Permalink
🐛 BASE #211 voltando com parametro dbms e correção de teste
Browse files Browse the repository at this point in the history
  • Loading branch information
bjverde committed Mar 25, 2024
1 parent b62077e commit bb5bc92
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions FormDin5/lib/widget/FormDin5/helpers/SqlHelper.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '/(%)/';
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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);
}
Expand Down

0 comments on commit bb5bc92

Please sign in to comment.