Skip to content

Releases: rotexsoft/leanorm

Major Minor Release

22 Jul 17:25
Compare
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
Compare
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

Minor Release

07 Jun 23:50
Compare
Choose a tag to compare
  • Updated the logic for calculating number of deleted records in deleteMatchingDbTableRows(array $cols_n_vals): int in the Model class
    • Now using a select count(*) with the same where conditions as the delete statement to get the count of matching values before and after executing the delete statement and then returning the difference of these values
    • The old method relied on PDOStatement::rowCount() which seems to have different behaviors for Sqlite & PostgreSQL under certain conditions
      • see https://www.php.net/manual/en/pdostatement.rowcount.php
        • public PDOStatement::rowCount(): int
          • This method returns "0" (zero) with the SQLite driver at all times, and with the PostgreSQL driver only when setting the PDO::ATTR_CURSOR statement attribute to PDO::CURSOR_SCROLL.

Full Changelog: 4.1.0...4.1.1

Minor Release

07 Jun 23:47
Compare
Choose a tag to compare
  • Updated the logic for calculating number of deleted records in deleteMatchingDbTableRows(array $cols_n_vals): int in the Model class

    • Now using a select count(*) with the same where conditions as the delete statement to get the count of matching values before and after executing the delete statement and then returning the difference of these values
    • The old method relied on PDOStatement::rowCount() which seems to have different behaviors for Sqlite & PostgreSQL under certain conditions
      • see https://www.php.net/manual/en/pdostatement.rowcount.php
        • public PDOStatement::rowCount(): int
          • This method returns "0" (zero) with the SQLite driver at all times, and with the PostgreSQL driver only when setting the PDO::ATTR_CURSOR statement attribute to PDO::CURSOR_SCROLL.
  • Documentation Updates

  • All Model, Collection & record classes now explicitly implement \Stringable

Full Changelog: 4.0.1...4.0.2

Minor Release

07 Jun 23:41
Compare
Choose a tag to compare
  • Updated the logic for calculating number of deleted records in deleteMatchingDbTableRows(array $cols_n_vals): int in the Model class
    • Now using a select count(*) with the same where conditions as the delete statement to get the count of matching values before and after executing the delete statement and then returning the difference of these values
    • The old method relied on PDOStatement::rowCount() which seems to have different behaviors for Sqlite & PostgreSQL under certain conditions
      • see https://www.php.net/manual/en/pdostatement.rowcount.php
        • public PDOStatement::rowCount(): int
          • This method returns "0" (zero) with the SQLite driver at all times, and with the PostgreSQL driver only when setting the PDO::ATTR_CURSOR statement attribute to PDO::CURSOR_SCROLL.

Full Changelog: 3.0.2...3.0.3

Major Minor Release

07 Jun 23:36
Compare
Choose a tag to compare
  • Updated the logic for calculating number of deleted records in deleteMatchingDbTableRows(array $cols_n_vals): int in the Model class

    • Now using a select count(*) with the same where conditions as the delete statement to get the count of matching values before and after executing the delete statement and then returning the difference of these values
    • The old method relied on PDOStatement::rowCount() which seems to have different behaviors for Sqlite & PostgreSQL under certain conditions
      • see https://www.php.net/manual/en/pdostatement.rowcount.php
        • public PDOStatement::rowCount(): int
          • This method returns "0" (zero) with the SQLite driver at all times, and with the PostgreSQL driver only when setting the PDO::ATTR_CURSOR statement attribute to PDO::CURSOR_SCROLL.
  • ReadOnlyRecord

    • protected function throwNotSupportedException($function_name): void
    • is now
    • protected function throwNotSupportedException(string $function_name): void
  • Documentation updates

Full Changelog: 2.2.5...2.3.0

Major Minor Release

06 Jun 02:51
Compare
Choose a tag to compare
  • Documentation updates
  • All queries generated by LeanOrm now strictly use named parameters / place-holders, which means all users of this library must use named parameters / place-holders in all their queries as PDO does not allow mixing and matching named parameters / place-holders & question-mark place-holders
  • The Model, Collection & Record classes now explicitly implement \Stringable

Full Changelog: 4.0.1...4.1.0

Minor Release

15 Mar 18:15
Compare
Choose a tag to compare
  • Updated documentation
  • Updated dev depndencies

Full Changelog: 4.0.0...4.0.1

New Major Release

13 Mar 18:45
Compare
Choose a tag to compare
  • Bumped min PHP version to PHP 8.1
  • Now using version 3.0+ of rotexsoft/gdao which is more strictly typed
  • Switched from aura/sqlschema to rotexsoft/sqlschema
  • Now using psr/log ^2.0.0 || ^3.0.0
  • Added ./run-tests-against-multiple-db-versions.php, a script for testing the package against multiple versions of MariaDB, MySQL & Postgres
  • Added more strict typing across the code base
  • Moved all exception classes to an Exceptions sub-folder & they are all in the \LeanOrm\Exceptions namespace
  • No longer using atlas/info for fetching db meta-data
  • Most methods that return self now return static
  • removeRecord(\GDAO\Model\RecordInterface $record): static has been added to the Collection class

Full Changelog: 3.0.2...4.0.0

Under the hood optimizations

04 Feb 01:42
Compare
Choose a tag to compare