Back to bug 39488

Who When What Removed Added
martin.renvoize 2025-03-31 09:23:00 UTC Blocks 39190
martin.renvoize 2025-03-31 12:17:53 UTC Assignee koha-bugs martin.renvoize
Status NEW Needs Signoff
martin.renvoize 2025-04-01 13:36:24 UTC Status Needs Signoff Signed Off
lucas 2025-06-04 16:02:10 UTC CC lucas
paul.derscheid 2025-06-05 12:37:26 UTC CC paul.derscheid
martin.renvoize 2025-08-01 13:44:49 UTC Attachment #179985 Attachment is obsolete 0 1
martin.renvoize 2025-08-01 13:44:51 UTC Attachment #179986 Attachment is obsolete 0 1
martin.renvoize 2025-08-01 13:44:53 UTC Attachment #179987 Attachment is obsolete 0 1
martin.renvoize 2025-08-01 13:44:56 UTC Attachment #180189 Attachment is obsolete 0 1
tomascohen 2025-08-08 17:47:04 UTC CC tomascohen
QA Contact testopia tomascohen
dcook 2025-08-10 23:20:07 UTC CC dcook
tomascohen 2025-08-29 14:23:55 UTC Patch complexity --- Small patch
Status Signed Off Passed QA
tomascohen 2025-08-29 14:23:57 UTC Attachment #185008 Attachment is obsolete 0 1
Attachment #185006 Attachment is obsolete 0 1
Attachment #185009 Attachment is obsolete 0 1
Attachment #185007 Attachment is obsolete 0 1
lucas 2025-09-03 17:26:59 UTC Status Passed QA BLOCKED
martin.renvoize 2025-09-05 14:27:06 UTC Status BLOCKED Passed QA
lucas 2025-09-19 19:25:53 UTC Version(s) released in 25.11.00
Status Passed QA Pushed to main
lucas 2025-09-19 19:26:51 UTC Keywords release-notes-needed
martin.renvoize 2025-09-29 14:53:27 UTC Text to go in the release notes Koha's object framework now supports polymorphic classing, define a `_polymorphic_class_map` method in your `Koha::Objects` class that returns a hashref mapping field values to class names. The framework will automatically instantiate the appropriate subclass based on the stored data.

A template for, and `as_list`.

**Use cases:**

- Transport protocols (FTP/SFTP) sharing a common table but requiring protocol-specific methods
- Account lines where debits and credits share a table but need type-specific behaviour
- Any scenario where related, allowing different object subclasses to be instantiated based on field values in shared database tables.

This enhancement updates `Koha::Object` and `Koha::Objects` classes to pass the original `DBIx::Class` result object to the `object_class` implementing polymorphic classes is included in the codebase. Test::Builder has also been updated to introspect polymorphic class maps for comprehensive testing. object types share storage but require distinct method implementations

**For developers:**

To implement polymorphic classes method, enabling dynamic class selection based on record content. This works across all standard retrieval methods including `find`, `find_or_create`, `single`, `next`, `last`
martin.renvoize 2025-09-29 14:53:32 UTC Keywords release-notes-needed

Back to bug 39488