herrera-io/doctrine-dateinterval
Adds DateInterval support to Doctrine DBAL and ORM. Provides a custom DBAL type (dateinterval) plus a DATE_INTERVAL DQL function so you can map and query PHP DateInterval values in entities and database fields.
start_date + interval) with declarative DQL functions like DATE_INTERVAL('P1Y'), improving query readability and maintainability.DateInterval field in Doctrine entities.DateInterval or a NoSQL database may suffice.DateTimeImmutable.For Executives:
"This package lets us store and query time intervals (e.g., 'every 6 months') directly in our database using Doctrine, reducing bugs from manual date calculations. For example, we could filter subscriptions expiring in <1 year with a simple query like WHERE expiry_date > DATE_INTERVAL('P1Y'). It’s a lightweight, MIT-licensed solution that integrates seamlessly with our existing Doctrine setup, saving dev time and improving data integrity for time-sensitive features like billing or scheduling."
For Engineers:
*"This adds a dateinterval Doctrine type and a DATE_INTERVAL DQL function, enabling native storage/querying of DateInterval objects. Key benefits:
P1Y2M) instead of strings/integers.WHERE duration < DATE_INTERVAL('P2Y')).How can I help you explore Laravel packages today?