Skip to content

Releases: rotexsoft/leanorm

Minor Major Release

14 Nov 06:51

Choose a tag to compare

  • 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

Minor Release

13 Nov 02:17

Choose a tag to compare

  • Code refactoring

Full Changelog: 5.1.2...5.1.3

Minor Release

13 Nov 00:38

Choose a tag to compare

Full Changelog: 5.1.1...5.1.2

Minor Release

27 Nov 11:49

Choose a tag to compare

  • Modified loading of belongsTo & hasOne relationship data to return an empty array for the scenario when there is no matching related record

Full Changelog: 5.1.0...5.1.1

Minor Release

27 Nov 11:47

Choose a tag to compare

  • Modified loading of belongsTo & hasOne relationship data to return an empty array for the scenario when there is no matching related record

Full Changelog: 4.1.1...4.1.2

Minor Release

27 Nov 11:46

Choose a tag to compare

  • Modified loading of belongsTo & hasOne relationship data to return an empty array for the scenario when there is no matching related record

Full Changelog: 4.0.2...4.0.3

Minor Release

27 Nov 11:43

Choose a tag to compare

  • Modified loading of belongsTo & hasOne relationship data to return an empty array for the scenario when there is no matching related record

Full Changelog: 3.0.3...3.1.0

Minor Release

27 Nov 11:42

Choose a tag to compare

  • Modified loading of belongsTo & hasOne relationship data to return an empty array for the scenario when there is no matching related record

Full Changelog: 2.3.0...2.4.0

Major Minor Release

22 Jul 17:25

Choose a tag to compare

  • Renamed method parameter names in belongsTo, hasOne & hasMany. Users calling these methods using the named argument syntax will need to update their code with the new names for these parameters / arguments
    • Renamed the $foreign_key_col_in_this_models_table parameter in belongsTo, hasOne & hasMany to $relationship_col_in_my_table
    • Renamed the $foreign_key_col_in_foreign_table parameter in belongsTo, hasOne & hasMany to $relationship_col_in_foreign_table

Full Changelog: 5.0.0...5.1.0

Major Release

21 Jul 13:04

Choose a tag to compare

  • New Major release still with a minimum requirement of PHP 8.1, but not backward compatible with the 4.x & prior versions of this package

  • Added \LeanOrm\Exceptions\BaseException, all LeanOrm Exception classes now extend this class instead of \Exception. You can catch \LeanOrm\Exceptions\BaseException to catch all LeanOrm generated exceptiopns.

  • Changed the method signatures of belongsTo, hasOne, hasMany & hasManyThrough in the Model class

  • belongsTo, hasOne, hasMany & hasManyThrough can now automatically use reflection on the Model class whose name is specified in the foreign_models_class_name parameter to set default values for the parameters below. These parameters can be omitted in calls to belongsTo, hasOne, hasMany & hasManyThrough if foreign_models_class_name is passed to these methods in addition to their required parameters

    • foreign_table_name
    • primary_key_col_in_foreign_table
    • foreign_models_record_class_name
    • foreign_models_collection_class_name
  • If you omit the foreign_models_class_name parameter when calling any of belongsTo, hasOne, hasMany & hasManyThrough, you must pass the foreign_table_name & primary_key_col_in_foreign_table parameters. In this situation, foreign_models_class_name, foreign_models_record_class_name & foreign_models_collection_class_name will be automatically assigned the values \LeanOrm\Model::class, \LeanOrm\Model\Record::class & \LeanOrm\Model\Collection::class respectively.

  • It is strongly recommended that you use PHP 8's named argument syntax when calling any of belongsTo, hasOne, hasMany & hasManyThrough, to promote more readable & easy to understand code whereever you define Model relationships within your applications.

Full Changelog: 4.1.1...5.0.0