Skip to content

Releases: AppsDevTeam/DoctrineLoggable

v4.2.3: ```

Choose a tag to compare

@thorewi thorewi released this 16 Oct 14:40
Add support for PHP 8.1 Enums in loggable identification
```
Previously, using an Enum in a LoggableIdentification field would result in a "Object of class ... could not be converted to string" error. This change ensures that backed enums are identified by their `value` and unit enums by their `name`.
```

v4.2.2: fix: Resolve change set references regardless of definition order

Choose a tag to compare

@thorewi thorewi released this 23 Sep 04:05
Previously, `$ref` entries in change sets would fail to resolve if their corresponding `$id` definition appeared later in the document. This led to `UnexpectedValueException` and unreadable change log entries.

This change pre-registers all `$id`s found in the document with empty `ChangeSet` instances before decoding begins. This ensures that any `$ref` can find its target instance, allowing for correct resolution even when `$ref` precedes `$id` in the document structure.

v4.2.1: fix: Record change log timestamps in UTC

Choose a tag to compare

@thorewi thorewi released this 20 Sep 12:58
Cas se bral v zone aplikace, takze change log nesel porovnat s ostatnimi logy
(request log, auditni stopa), ktere UTC pisou vzdycky - a v oddelenem ulozisti,
kam se odvazeji spolecne, se zaznamy rozchazely o posun zony.

v4.2: Add support for redacting sensitive property values in change logs

Choose a tag to compare

@thorewi thorewi released this 19 Sep 08:19
Introduce a mechanism to log that a property has changed without storing its actual value.
This allows auditing the fact of a change (e.g., a password update) while preventing
sensitive data (like password hashes) from being stored in log history.

v4.1: Add `onLogEntry` hook for reacting to stored changes

Choose a tag to compare

@thorewi thorewi released this 19 Sep 08:00
Introduces a configurable callback mechanism (`LoggableListener::$onLogEntry`)
that allows external services to process change log entries after they have
been successfully persisted to the database.

This enables use cases like audit trails, notifications, or search index updates.
The callback is executed in `postFlush` and receives:
- The `ChangeLog` entity with its assigned ID.
- The original tracked entity.
- An `announced` flag, indicating if the same `ChangeLog` entry (for the same
  entity) has been announced before within the current request, typically
  meaning its change set has grown.

v4.0.1

Choose a tag to compare

@thorewi thorewi released this 12 Sep 05:27
Remove redundant PSR-4 autoload definition

v4.0: Merge pull request #14 from AppsDevTeam/feature/json-change-sets

Choose a tag to compare

@thorewi thorewi released this 31 Aug 11:14
9729b2f
Stores change sets as JSON

v3.0.5: Skip collection lookup for unrelated entity types

Choose a tag to compare

@thorewi thorewi released this 29 Aug 10:00
Logovaná entita má obvykle víc kolekcí a všem se předává tatáž změněná
entita. U kolekce na inverzní straně se pak na té entitě četlo pole podle
mappedBy - i když do kolekce vůbec typem nepatřila a takové pole neměla.
Skončilo to na 'Call to a member function getValue() on null'.

v3.0.4: Prevent memory exhaustion in change set processing

Choose a tag to compare

@thorewi thorewi released this 29 Aug 05:54
Addresses two distinct scenarios that previously led to Out-Of-Memory errors during change set calculation:

1.  **Cyclic entity graphs:** Implements a recursion guard (`$changeSetsInProgress`) to prevent infinite loops when processing entities with circular references, which would otherwise consume all available memory.
2.  **Large collections:** Optimizes checking for entity presence within a collection (`isEntityInCollection`) to avoid hydrating potentially massive Doctrine PersistentCollections. It now leverages `mappedBy` metadata for uninitialized collections, preventing excessive memory usage for large related datasets.

v3.0.3: Remove redundant reflection property accessibility

Choose a tag to compare

@thorewi thorewi released this 23 Jun 09:39
The properties being accessed via reflection no longer require explicit `setAccessible(true)` calls, streamlining the reflection process without altering behavior.