cycle / orm

PHP DataMapper, ORM
https://cycle-orm.dev
MIT License
1.23k stars 72 forks source link

💡 Mass Prunable Functionality for Cycle ORM Entities #434

Open lotyp opened 1 year ago

lotyp commented 1 year ago

I have an idea!

Introduce a mass prunable functionality in cycle/orm akin to what Laravel offers, allowing entities to be periodically pruned based on custom conditions. This enhancement will make managing large datasets more efficient and keep databases lean, especially for entities that are time-sensitive or have a shelf life.

Current Behavior:

Currently, cycle/orm doesn't provide out-of-the-box support for pruning entities based on conditions or age. Entities need to be manually queried and then removed, which can be cumbersome and inefficient for large datasets.

Desired Behavior:

[Behavior\SoftDelete(
    field: 'deletedAt',
    column: 'deleted_at',
    prunable: true
)]