Repository navigation
3.5.3
Full Changelog: 3.5.2...3.5.3
New Features
Database Query Builder
The Database ORM class introduces new methods to support a wider range of use cases, enhancing flexibility and control over query building and execution.
raw- Allows passing raw SQL expressions using theLuminova\Database\RawExpressionclass.strict- Enables or disables strict mode forWHEREclauses inDELETEorUPDATEqueries.having- Adds filtering for grouped results using aggregate functions.isNull- Adds a condition to filter results where the specified column isNULL.isNotNull- Adds a condition to filter results where the specified column is notNULL.notIn- Adds aNOT IN (...)condition to exclude values from the result.conjoin- Groups multiple conditions usingANDorOR(e.g.,WHERE (a OR b)).nested- Nests multiple grouped conditions usingAND/ORlogic (e.g.,WHERE ((a OR b) AND (c OR d))).column- A helper to create structured column conditions forconjoinandnested, improving readability.onDuplicate- Defines behavior for handling duplicate keys duringINSERToperations.ignoreDuplicate- Allows skipping duplicate key errors when inserting records.inTransaction- Returns whether a transaction is currently active.getDebug- Retrieves debug information ifdebug()was called before executing the query.closeAfter- Enables or disables automatic connection closure after query execution (default:false).
Mailer Helper Class
options- Set custom stream context options for the SMTP connection (e.g., SSL/TLS settings).addresses- Add multiple recipients using a comma-separated string, a simple array of emails, or an associative array withname => emailformat.notification- Specify an email address to receive delivery and read receipt notifications.addHeader- Add custom headers to the outgoing email (e.g.,X-Priority,List-Unsubscribe).isHtml- Toggle the email format between HTML and plain text.isMail- Set the transport method to either nativemailorSMTP.
Raw SQL Expression
The Luminova\Database\RawExpression class provides a way to include raw SQL expressions without quoting or escaping.
Predefined helper methods are available:
now,year,month,day,time- Common time-based SQL functions.count,sum,average- Aggregate functions for grouped data.increment,decrement- SQL math expressions for numeric operations.currents- Returns an array with:currentDate,currentYear,currentMonth,currentDay,currentHour,currentMinute, andcurrentSecond.
Input Validation Class
is_value- Validates that an input field exactly matches the specified value.
Optimizations
Database Query Builder
The query builder received significant performance improvements, including optimized driver initialization and connection management.
exec- Method signature changed tostatic.on- Supports lateral values like'"value"'or raw expressions when joining; any non-expression is treated as a column name.where- Improved to accept arrays forIN (...)and optionalNOTforNOT IN (...).datetime- Now supports timezone-aware formatting.returns- Can now return the raw prepared statement usingstmt().printDebug- Enhanced to output debug info conditionally based on the environment.insert- Updated to support automatic handling of duplicate key behavior (update or ignore).
Renamed
HTTP Request Class
isAJAX→isAjax
Database Query Builder
andGroup→andConjoinorGroup→orConjoinandBind→andNestedorBind→orNested