Releases: phpfui/ORM
Releases · phpfui/ORM
PHP 8.4 Support
- Support for PHP 8.4
- Auto increment fields are no longer set to required in validator generation
- Refactored to reduce line count
- Assignment of empty related Record now works correctly
Better IN (select statement) logic
Reduced the number of queries to the server for using a SELECT statement for the IN and NOT IN operators.
IN conditions with empty arrays will always return false
To avoid an error from SQL, IN conditions with empty arrays will always return false
Don't Cast Nulls
- Null fields were always being casted to the field type. Now the field will be null.
- Improved documentation
Better Validator::unique logic
- Correctly reports the value of the field that is not unique when using additional column constraints
- Cases the table class correctly for additional column constraints
Enum support in Condition
- Enums can now be used as values in Condition objects without having to use MyEnum::MY_VALUE->value
- Example: $condition = new \PHPFUI\ORM\Condition('field', MyEnum::MY_VALUE);
- Added Table::validateFromTable method to perform record validation before calling updateFromTable
Type Safe Enum support
Out of the box type safe enum support.
Better default JOINs
- Table::addJoin() now has better defaults
- If $on is empty, then the following defaults are tried:
- Join on the primary key of the join table if it exists on both tables
- If field does not exist on both tables, then use the primary key of the main table
- If $on is a non-empty string, use as the join field
- Use \PHPFUI\ORM\Condition for complex joins
- If $on is empty, then the following defaults are tried:
- Table::update() now supports joins
- Literal class is now supported for Condition
Table::find() is now specific to the table
- find() adds the table name for where condition
- Support for PHPUnit 11
Better @property tags for related records
Auto generated related record @Property tags where wrong for ID suffixes that were not 2 characters.