Skip to content

Releases: justim/access

v1.22.1

03 Apr 13:15
9f3df7d

Choose a tag to compare

  • Accept OrderByInterface in collection sort method
  • Add utilities to Lock to combine locks, easily combine two locks configs together before locking

Full Changelog: v1.22.0...v1.22.1

v1.22.0

12 Feb 15:04
75b3cba

Choose a tag to compare

What's Changed

Pull requests

  • Drivers by @justim in #11
  • Tiny contribution to fix provideCollection method template by @yrodchyn in #12
  • Split lint and test GitHub actions + PHP 8.4 by @justim in #13
  • Psalm 6 + presenter improvements by @justim in #14

Full Changelog: v1.21.0...v1.22.0

Nested transactions + filter clauses

27 Jun 14:09
v1.17.0
a663719

Choose a tag to compare

Nested transactions

  • Inner transactions will use savepoints to roll back to

Filter clauses

  • Filter the presentation markers in a declarative way

Full Changelog: v1.16.1...v1.17.0

Improved generic typings + clauses for multiple

08 Mar 10:55
67c97f8

Choose a tag to compare

Improved generic typings

  • This gives a better usage of the helper methods of collection
  • The presenter now better understands what entity it is dealing with
  • Start linting tests to give better insight

Rework how multiple entities are handled in presenters

  • Removal of workaround for broken JSON responses
  • Clauses to presentMultiple

Full Changelog: v1.15.3...v1.16.0

Rework query conditions + PHP 8.0

14 Jan 11:32
eef807e

Choose a tag to compare

Rework query conditions

A rework of the query condition internals allows for a new external API as well:

$query = new Query\Select(User::class);
$query->where(Equals('id', 4));

These are the same conditions that are already in use in the presenters, for additional query clauses when selecting data.

The main reason this is helpful for queries is that it is now possible to use multiple conditions with multiple placeholders. The following indicates a query that was not previously possible:

$query = new Query\Select(User::class);
$query->whereOr([
    'first_name = ? AND last_name = ?' => 'Dave', // second placeholder is not possible
    'is_admin = ?' => true,
]);

With the new conditions API it is now possible:

$query = new Query\Select(User::class);
$query->where(new MultipleOr(
    new Multiple(
        new Equals('first_name = ?', 'Dave'),
        new Equals('last_name = ?', 'Johnny'), // second placeholder is now possible
    ),
    new Equals('is_admin = ?', true),
));

The new API is very much optional and the string like interface still works as expected and is converted to the conditions automatically internally.

Updated PHP dependency

From this release forward the minimal required PHP version is 8.0.

Allow entities to be passed as a value

12 Aug 13:34
ce2d7a7

Choose a tag to compare

This makes it a bit easier to build queries and select entities

This is now allowed:

// finder methods
$repo->findBy([
    // an entity `Entity`
    'id' => $user,

    // a collection `Collection`
    'id' => $users,
]);

// query builder
$query->innerJoin(SomeEntity::class, [
    'other_table.user_id = ?' => $user,
]);

Convert entities with presenters

26 Jun 12:05

Choose a tag to compare

New features

  • Presenters: Easily present your entities as JSON without worrying about n+1 queries
  • Filter method on collections

Changes

  • Use prettier to format all code

Grouped collections

13 Feb 10:59
b93f3f6

Choose a tag to compare

Use GroupedCollection instead of plain array, this makes type-hinting a lot easier and maybe some nice feature in the future

Subqueries, locks and more

10 Dec 12:48
74f2eaf

Choose a tag to compare

New features:

  • Subqueries in virtual fields
  • Simple lock mechanism
  • Add hydration times to profile
  • A couple more helper methods for collections

Changes:

  • Add support for where statements with same condition

Transactions and more

23 Oct 11:38
a7598df

Choose a tag to compare

New in this release:

  • Transactions:

    $transaction = $db->beginTransaction();
    
    // your fancy insert/update queries
    
    $transaction->commit();
    // or
    $transaction->rollBack();
    
    // make sure to either commit or roll back, otherwise an exception is thrown
  • More type information with Psalm

  • Small setup with a single benchmark

  • A new save method if you don't want to think about choosing between insert and update