Skip to content

About

Symfony bundle with doctrine extensions

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

dontdrinkandroot/doctrine-bundle

Latest Stable Version License Continuous Integration Coverage Maintainability Rating Reliability Rating Security Rating

Types

instant

Maps Dontdrinkandroot\Common\Instant to an epoch-millis BIGINT column (like a Java long holding System.currentTimeMillis()). On PostgreSQL the column is TIMESTAMP(6) WITH TIME ZONE instead (like Hibernate's mapping of java.time.Instant), while the PHP representation remains epoch millis.

Transparent parameter binding

The bundle registers a Doctrine DBAL middleware that converts Instant query parameters to their database representation automatically — you never need to specify the type explicitly:

$query->setParameter('createdAt', $instant);            // just works
$query->setParameter('createdAt', $instant, 'instant'); // still works, never converted twice

This applies to all queries — DQL, QueryBuilder, native SQL and IN (...) lists. The conversion is identical to an explicit instant bind: epoch millis on non-PostgreSQL platforms, UTC timestamp strings on PostgreSQL. All other parameter values pass through unchanged.

About

Symfony bundle with doctrine extensions

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages