Releases: phpfui/ORM
Default Nullable Date and Time Fields fix
Limit fields updated on setFrom
The second parameter to setFrom is now an array of fields that will be set. This allows you to limit what fields get updated. The default is to update all fields appearing in the first parameter to setFrom().
This introduces a minor breaking change used for internal purposes and should not affect application code. The old second parameter (bool $loaded = false) is now the third parameter. PHPStan will detect this change if used.
Null related record assignment
- Set related record id to null if related record is empty and field is nullable. Previously set to zero.
Correct default for migration::run field
Migrations will now run correctly on MySQL and MariaDB
Updated Internals - Rerun \PHPFUI\ORM\Tool\Generate\CRUD
Internal refactor for typed field definitions.
WARNING: You must rerun the \PHPFUI\ORM\Tool\Generate\CRUD class against your database. See scripts/generateCRUD.php for an example. No other changes will be needed.
Fixed support for nullable CURRENT_TIMESTAMP and CURRENT_DATE defaults.
Better support for Virtual fields
- Virtual fields now support null better.
- Enums set to null default to 0.
- Cast will not convert null.
Fix for Enums in setFrom
setFrom method now calls __set for custom setters.
Allow * for addSelect()
- '*' is a valid field for addSelect()
- Null defaults to zero when assigning to an Enum
Better field sanitation
Better sanitation for fields to prevent injections attacks on user supplied fields
Null Assignments
- Detect null assignment to non nullable fields
- Better support for default float values of 0.0 (requires regen of Definition classes)