Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Doctrine Extensions Laravel Package

oro/doctrine-extensions

Adds extra Doctrine DQL functions and field types for MySQL and PostgreSQL (e.g., DATE/TIME, TIMESTAMPDIFF, CONVERT_TZ, DAY/WEEK/MONTH, MD5). Includes registration examples for common frameworks and guidance for extending platforms/functions.

View on GitHub
Deep Wiki
Context7
3.0.1

Restricts the target type of the CAST DQL function to the supported type names and to a numeric length or precision, so a query expression can no longer place arbitrary text into the type position of the generated SQL.

What is changed

  • A CAST expression is accepted only when its target type is one of the documented type names. A name that merely begins with a supported one, such as timestamp or int8, is now rejected as unsupported.
  • A parenthesised length or precision is accepted only as non-negative integers, so CAST(expr as char(5)) and CAST(expr as decimal(10, 2)) keep working and any other content is reported as a syntax error.
  • jsonb is a supported type name in its own right, so a cast to it is accepted and renders as it did before.
  • A type that carries a length or a precision is mapped to the platform's own type name, so CAST(expr as string(12)) produces varchar(12) on PostgreSQL and char(12) on MySQL instead of being passed through unchanged.
  • Every supported type given without a length or a precision produces the same SQL as before on both platforms.

Impact

  • Applications that rely on a platform-specific type spelling accepted only because it shares a prefix with a supported name (timestamp, timestamptz, int8) now get a syntax error and have to use one of the supported type names.
  • Queries that use the documented types, with or without a length or a precision, are unaffected, and the SQL generated for them is unchanged.
  • The dependency requirements are untouched, so a release from this branch installs alongside doctrine/orm 2.8 with doctrine/lexer 1 and doctrine/dbal 2.12, which is the combination OroPlatform 4.2 is fixed to.
  • No configuration changes or upgrade steps are required.
3.0

Release 3.0 - Doctrine ORM 3 Support

Overview

This major release brings full compatibility with Doctrine ORM 3.0, representing a significant modernization of the library to support the latest PHP and Doctrine ecosystem standards.

Requirements & Compatibility

  • PHP 8.1+ Required - Minimum PHP version raised from 7.3 to 8.1
  • Doctrine ORM 3.0+ Support - Full compatibility with Doctrine ORM 3.0
  • Dropped Doctrine ORM 2.x Support - Version 2.x branches should be used for Doctrine ORM 2.x projects

What's Changed

Core Updates

  • Complete codebase refactoring for Doctrine ORM 3.0 compatibility
  • Updated all AST functions to work with new Doctrine ORM 3.0 query parser
  • Modernized code to leverage PHP 8.1+ features

API Changes

The following method signatures have been updated. If you have created custom functions by extending library classes, you may need to update your code:

  • FunctionFactory::create(string $platformName, string $functionName, array $parameters): PlatformFunctionNode
  • Cast#checkType($type) has been replaced with isSupportedType(string $type): bool
  • TimestampDiff#checkUnit($unit) has been replaced with isSupportedUnit(string $unit): bool
  • AbstractTimestampAwarePlatformFunctionNode#getTimestampValue($expression, SqlWalker $sqlWalker): string

Included PRs

Migration Guide

If you only registered the functions and types provided by this library with Doctrine, most likely you do not need to make any changes to your code. Simply update your composer.json:

{
    "require": {
        "oro/doctrine-extensions": "^3.0"
    }
}

Credits

This release was made possible by the Oro team and community contributors who worked to ensure compatibility with Doctrine ORM 3.0. Special thanks to all who tested the alpha and beta releases.

New Contributors

Documentation

Reporting Issues

If you encounter any issues with this release, please report them on our GitHub Issues page.


Full Changelog: https://github.com/oroinc/doctrine-extensions/compare/2.0.5...3.0

3.0-beta1

What's Changed

New Contributors

Full Changelog: https://github.com/oroinc/doctrine-extensions/compare/3.0-alpha4...3.0-beta1

2.0.4
  • locked doctrine/lexer to versions lower that 3
3.0-alpha2

Updated composer.json

3.0-alpha1

In this release will be introduced compatibility with latest versions of Doctrine Moved to latest PHPUnit

2.0.3
  • added support of UUID to CAST
  • updated dependencies
2.0.2
1.3.2

Fixed Issue #78 Error when using DATE_FORMAT when used with PHP 8

1.2.3

Fixed Issue #78 Error when using DATE_FORMAT when used with PHP 8

2.0.1

Fixed Issue #78 Error when using DATE_FORMAT when used with PHP 8

2.0.0

Version 2.0.0 requires:

  • PHP 7.3 or newer
  • Doctrine ORM 2.6 or newer

If you just registered the functions and types provided by this library with Doctrine then most likely you do not need to make any changes in your code.

If you have created your own custom functions or types by extending any classes from this library, or if you work with these functions and types directly from your PHP code, then you may need to update your code. Check the upgrade instructions in UPGRADE.md for details.

1.3.1
1.3.0
1.2.2
1.2.1

Usage in DQL CAST(value as binary). Will produce next SQL:

  • MySQL CAST(value as binary)
  • PostgreSQL CAST(value as bytea)

Minimum PHP version update to 5.4

1.1.3

Usage in DQL CAST(value as binary). Will produce next SQL:

  • MySQL CAST(value as binary)
  • PostgreSQL CAST(value as bytea)

Minimum PHP version update to 5.4

1.2.0

The DATE_FORMAT() function formats a date as specified by a format mask.

1.1.2
  • fixed PostgreSQL implementation of TIMESTAMPDIFF function to match results returned by MySQL implementation
1.0.15
  • fixed PostgreSQL implementation of TIMESTAMPDIFF function to match results returned by MySQL implementation
1.1.1
1.0.14
1.1.0
  • Replace function added
  • updated build test matrix, added maria db, percona db, latest versions of mysql and postgresql, dropped support of PHP 5.3

Note! Starting this release new features will be with minor version change

1.0.13
  • Added MD5 string function support
1.0.12

Fixed issue #19

1.0.11
  • added support for cast to boolean
  • fixed cast of negative values
  • added build for posgresql 9.4
  • fixed YAML component version
1.0.10

Added CAST to JSON on supported platforms, for others will be casted as string

1.0.9

Added CONCAT_WS support

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect
youbar/easy-crud
c-point-labs/laravel-hostyourai
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo