@@ -85,6 +85,9 @@ class PicoDatabasePersistence // NOSONAR
8585 const COMMA_RETURN = ", \r\n" ;
8686 const INLINE_TRIM = " \r\n\t " ;
8787 const ALWAYS_TRUE = "(1=1) " ;
88+
89+ const IS_NULL = " is null " ;
90+ const CLAUSE_AND = " and " ;
8891
8992 /**
9093 * Database connection
@@ -929,7 +932,7 @@ private function getWhere($info, $queryBuilder)
929932 $ value = $ queryBuilder ->escapeValue ($ value );
930933 if (strcasecmp ($ value , self ::KEY_NULL ) == 0 )
931934 {
932- $ wheres [] = $ columnName . " is null " ;
935+ $ wheres [] = $ columnName . self :: IS_NULL ;
933936 }
934937 else
935938 {
@@ -940,7 +943,7 @@ private function getWhere($info, $queryBuilder)
940943 {
941944 throw new NoPrimaryKeyDefinedException ("No primary key defined " );
942945 }
943- return implode (" and " , $ wheres );
946+ return implode (self :: CLAUSE_AND , $ wheres );
944947 }
945948
946949 /**
@@ -977,7 +980,7 @@ private function getWhereWithColumns($info, $queryBuilder)
977980 $ escapedValue = $ queryBuilder ->escapeValue ($ value );
978981 if (strcasecmp ($ escapedValue , self ::KEY_NULL ) == 0 )
979982 {
980- $ wheres [] = $ columnName . " is null " ;
983+ $ wheres [] = $ columnName . self :: IS_NULL ;
981984 $ columns [$ columnName ] = null ;
982985 }
983986 else
@@ -992,7 +995,7 @@ private function getWhereWithColumns($info, $queryBuilder)
992995 }
993996
994997 $ result ->columns = $ columns ;
995- $ result ->whereClause = implode (" and " , $ wheres );
998+ $ result ->whereClause = implode (self :: CLAUSE_AND , $ wheres );
996999 return $ result ;
9971000 }
9981001
@@ -2150,14 +2153,14 @@ private function createWhereByPrimaryKeys($queryBuilder, $primaryKeys, $property
21502153 $ columnValue = $ propertyValues [$ index ];
21512154 if ($ columnValue === null )
21522155 {
2153- $ wheres [] = $ columnName . " is null " ;
2156+ $ wheres [] = $ columnName . self :: IS_NULL ;
21542157 }
21552158 else
21562159 {
21572160 $ wheres [] = $ columnName . " = " . $ queryBuilder ->escapeValue ($ propertyValues [$ index ]);
21582161 }
21592162 }
2160- $ where = implode (" and " , $ wheres );
2163+ $ where = implode (self :: CLAUSE_AND , $ wheres );
21612164 if (!$ this ->isValidFilter ($ where ))
21622165 {
21632166 throw new InvalidFilterException (self ::MESSAGE_INVALID_FILTER );
0 commit comments