Skip to content

Minor Major Release

Choose a tag to compare

@rotexdegba rotexdegba released this 14 Nov 06:51
· 12 commits to master since this release
  • Change in the behavior of calling unset to unset a property of a Record (that could be a table column, relationship name, or [non-table & non-relationship data])
    • Old Behavior: When you previously called unset on a record like this (unset($record->property_name) or unset($record['property_name'])), $record->property_name or $record['property_name'] is set to null and returns null when accessed after the unset operation.
    • New Behavior: When you call unset on a record like this (unset($record->property_name) or unset($record['property_name'])), property_name is totally removed from the appropriate internal array
      • When you try to access $record->property_name or $record['property_name'] after the unset,
        • if property_name is a database table column, null will be returned
        • if property_name is a relationship name, an attempt will be made to try to reload the related data from the database if there is enough data in the record, else null will be returned
        • if property_name was a non-table & non-relationship field, a \LeanOrm\Exceptions\Model\NoSuchPropertyForRecordException will be thrown as that the (non-table & non-relationship) property has been removed entirely when unset was called

Full Changelog: 5.1.3...5.2.0