Search by

dontdrinkandroot / doctrine-bundle

philipsorst

Symfony Bundle that provides Doctrine Utilities

Package info

github.com/dontdrinkandroot/doctrine-bundle.php

Type:symfony-bundle

pkg:composer/dontdrinkandroot/doctrine-bundle

Statistics

Installs: 5 934

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1 2016-04-24 18:41 UTC

This package is auto-updated.

Last update: 2026-10-16 08:47:06 UTC


README

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.