Doctrine2 behavioral extensions

Overview

SonataDoctrineExtensions

Doctrine2 behavioral extensions

Latest Stable Version Latest Unstable Version Psalm Type Coverage License

Total Downloads Monthly Downloads Daily Downloads

Branch Github Actions Code Coverage
1.x Test Coverage Status
2.x Test Coverage Status

Support

For general support and questions, please use StackOverflow.

If you think you found a bug or you have a feature idea to propose, feel free to open an issue after looking at the contributing guide.

License

This package is available under the MIT license.

Comments
  • Fix addAssociation, addDiscriminatorColumn and addOverride on DoctrineCollector

    Fix addAssociation, addDiscriminatorColumn and addOverride on DoctrineCollector

    Subject

    I am targeting this branch, because without this fix it is imposible to use this feature.

    I am trying to use this bundle to generate dynamic mapping here: https://github.com/Runroom/RunroomSamplesBundle/blob/master/src/DependencyInjection/RunroomSamplesExtension.php#L43

    I had to stop using it and return to the EasyExtendsBundle way. Why? Because I keep getting an error similar to this: https://stackoverflow.com/questions/44323315/symfony-compiler-pass-i-want-to-add-method-call-to-logger-service

    I think the problem is trying to use the compiler pass to add calls with objects without using definitions: https://github.com/sonata-project/sonata-doctrine-extensions/blob/1.x/src/Bridge/Symfony/DependencyInjection/Compiler/MapperCompilerPass.php#L41

    That $options without this patch is an array containing an object, for some reason, Symfony does not like it.

    I do not fully understand the problem, but I found this solution. I open the PR to discuss if it is the best approach or not. I know it is a BC break, but we should consider that actually this feature is imposible to use without an error. Of course, if the fix is accepted and test need fixing, I can do it.

    Changelog

    ### Fixed
    - Fix modifying entities (associations, discriminator columns and overrides) with DoctrineCollector
    
    patch 
    opened by jordisala1991 34
  • Moved stuff from CoreBundle

    Moved stuff from CoreBundle

    I am targeting this branch, because this is BC.

    Changelog

    ### Added
    - Added all doctrine stuff from `SonataCoreBundle`
    

    Subject

    This will move all doctrine stuff from the old SonataCoreBundle to this bundle (https://github.com/sonata-project/dev-kit/issues/348).

    minor 
    opened by core23 19
  • Fix static analysis of ObjectRepository interface

    Fix static analysis of ObjectRepository interface

    Subject

    Make BaseEntityManager::getRepository returns an Doctrine\ORM\EntityManager

    I am targeting this branch, because this should have no effect on executed code. The goal is to fix static analysis of php code as Doctrine\Common\Persistence\ObjectRepository interface does not have the createQueryBuilder method.

    pedantic 
    opened by mazsudo 15
  • Adding TransactionalManagerInterface

    Adding TransactionalManagerInterface

    Subject

    I am targeting this branch, because it has the support for the php 7.4 version.

    Related with https://github.com/sonata-project/SonataPageBundle/pull/1550.

    Changelog

    ### Added
    - Added `TransactionalManagerInterface::class` interface.
    
    ### Changed
    - Implements `TransactionalManagerInterface` in `BaseEntityManager` abstract class
    
    minor 
    opened by eerison 11
  • Fix #218

    Fix #218

    Fixed #218

    Check adapter exists before adding.

    if ($container->has('sonata.doctrine.adapter.doctrine_phpcr')) {
        $definition->addMethodCall('addAdapter', [new Reference('sonata.doctrine.adapter.doctrine_phpcr')]);
    }
    patch pending author 
    opened by MaxE17677 11
  • The annotation

    The annotation "@extends" in class Sonata\Doctrine\Entity\BaseEntityManager was never imported

    Environment

    Symfony 4.4 application on Apache on Linux and Windows.

    Sonata packages

    sonata-project/admin-bundle              3.62.1 3.63.0 The missing Symfony Admin Generator
    sonata-project/block-bundle              3.18.4 3.18.4 Symfony SonataBlockBundle
    sonata-project/cache                     2.0.1  2.0.1  Cache library
    sonata-project/core-bundle               3.18.0 3.18.0 Symfony SonataCoreBundle (abandoned)
    sonata-project/datagrid-bundle           2.5.0  3.1.1  Symfony SonataDatagridBundle
    sonata-project/doctrine-extensions       1.6.0  1.6.0  Doctrine2 behavioral extensions
    sonata-project/doctrine-orm-admin-bundle 3.15.0 3.15.0 Symfony Sonata / Integrate Doctrine ORM into the SonataAdminBundle
    sonata-project/easy-extends-bundle       2.5.0  2.5.0  Symfony SonataEasyExtendsBundle
    sonata-project/exporter                  2.2.0  2.2.0  Lightweight Exporter library
    sonata-project/media-bundle              3.24.0 3.24.0 Symfony SonataMediaBundle
    sonata-project/user-bundle               4.5.2  4.5.2  Symfony SonataUserBundle
    

    Symfony packages

    symfony/contracts             v1.1.8  v2.0.1  A set of abstractions extracted out of the Symfony components
    symfony/monolog-bundle        v3.5.0  v3.5.0  Symfony MonologBundle
    symfony/phpunit-bridge        v4.4.5  v5.0.5  Symfony PHPUnit Bridge
    symfony/polyfill-apcu         v1.14.0 v1.14.0 Symfony polyfill backporting apcu_* functions to lower PHP versions
    symfony/polyfill-ctype        v1.14.0 v1.14.0 Symfony polyfill for ctype functions
    symfony/polyfill-iconv        v1.14.0 v1.14.0 Symfony polyfill for the Iconv extension
    symfony/polyfill-intl-icu     v1.14.0 v1.14.0 Symfony polyfill for intl's ICU-related data and classes
    symfony/polyfill-intl-idn     v1.14.0 v1.14.0 Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions
    symfony/polyfill-mbstring     v1.14.0 v1.14.0 Symfony polyfill for the Mbstring extension
    symfony/polyfill-php56        v1.14.0 v1.14.0 Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions
    symfony/polyfill-php72        v1.14.0 v1.14.0 Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions
    symfony/polyfill-php73        v1.14.0 v1.14.0 Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions
    symfony/polyfill-util         v1.14.0 v1.14.0 Symfony utilities for portability of PHP codes
    symfony/security-acl          v3.0.4  v3.0.4  Symfony Security Component - ACL (Access Control List)
    symfony/swiftmailer-bundle    v3.4.0  v3.4.0  Symfony SwiftmailerBundle
    symfony/symfony               v4.4.5  v5.0.5  The Symfony PHP framework
    symfony/webpack-encore-bundle v1.7.3  v1.7.3  Integration with your Symfony app & Webpack Encore!
    

    Doctrine packages

    doctrine/annotations                v1.8.0  v1.8.0  Docblock Annotations Parser
    doctrine/cache                      1.10.0  1.10.0  PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such as redis, memcache, apc, mongodb and others.
    doctrine/collections                1.6.4   1.6.4   PHP Doctrine Collections library that adds additional functionality on top of PHP arrays.
    doctrine/common                     2.12.0  2.12.0  PHP Doctrine Common project is a library that provides additional functionality that other Doctrine projects depend on such as better reflection support, persistence interfaces, proxies, event system and much more.
    doctrine/data-fixtures              1.4.2   1.4.2   Data Fixtures for all Doctrine Object Managers
    doctrine/dbal                       v2.10.1 v2.10.1 Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.
    doctrine/doctrine-bundle            1.12.7  2.0.7   Symfony DoctrineBundle
    doctrine/doctrine-cache-bundle      1.4.0   1.4.0   Symfony Bundle for Doctrine Cache
    doctrine/doctrine-fixtures-bundle   3.3.0   3.3.0   Symfony DoctrineFixturesBundle
    doctrine/doctrine-migrations-bundle 2.1.2   2.1.2   Symfony DoctrineMigrationsBundle
    doctrine/event-manager              1.1.0   1.1.0   The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects.
    doctrine/inflector                  1.3.1   1.3.1   Common String Manipulations with regard to casing and singular/plural rules.
    doctrine/instantiator               1.3.0   1.3.0   A small, lightweight utility to instantiate objects in PHP without invoking their constructors
    doctrine/lexer                      1.2.0   1.2.0   PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.
    doctrine/migrations                 2.2.1   2.2.1   PHP Doctrine Migrations project offer additional functionality on top of the database abstraction layer (DBAL) for versioning your database schema and easily deploying changes to it. It is a very easy to use and a powerful tool.
    doctrine/orm                        v2.7.2  v2.7.2  Object-Relational-Mapper for PHP
    doctrine/persistence                1.3.7   1.3.7   The Doctrine Persistence project is a set of shared interfaces and functionality that the different Doctrine object mappers share.
    doctrine/reflection                 1.2.0   1.2.0   The Doctrine Reflection project is a simple library used by the various Doctrine projects[...]
    

    PHP version

    PHP v7.2 and v7.4.3
    

    Subject

    Since updating this library from 1.5.1 to 1.6.0 I get the following error when clearing the Symfony cache:

     $ php bin/console cache:clear -e dev
    
    In AnnotationException.php line 54:
                                                                                                                                                                                             
      [Semantical Error] The annotation "@extends" in class Sonata\Doctrine\Entity\BaseEntityManager was never imported. Did you maybe forget to add a "use" statement for this annotation?
    
    bug unconfirmed 
    opened by IwfY 11
  • Use generic annotations

    Use generic annotations

    Feature Request

    We could add @template annotations to our interfaces to provide more specific metadata.

    Here's an example from doctrine: https://github.com/doctrine/collections/blob/master/lib/Doctrine/Common/Collections/Collection.php#L29-L32

    The following classes could benefit from this:

    • Model/ManagerInterface.php
    • Adapter/AdapterInterface.php
    feature keep 
    opened by core23 8
  • Trigger deprecated types autoload

    Trigger deprecated types autoload

    Subject

    By loading the deprecated type, we make sure the class alias they contains exist, so that code type hinting against the old type accepts the new. This is necessary because type hinting does not trigger autoload, since it usually does not need to.

    Contrary to #107, the alias will not be created if sonata/core-bundle is not installed, which should not happen since code type hinting against an interface from that package is supposed to require it explicitely.

    I am targeting this branch, because this is BC.

    Fixes #108, Closes #107

    Changelog

    ### Fixed
    - crash about type hinting issues with AdapterInterface
    
    patch 
    opened by greg0ire 7
  • Cleanup gitignore file

    Cleanup gitignore file

    I am targetting this branch, because this is a pedantic change.

    Subject

    Removes platform entries and old unused files.

    Refs: https://github.com/sonata-project/dev-kit/issues/211

    pedantic 
    opened by core23 7
  • Return null in JsonType

    Return null in JsonType

    Return null if json field is null instance of throwing an error

    In commit https://github.com/sonata-project/sonata-doctrine-extensions/commit/8a4cd230ae0939f4984151bb725abfc47dbae351 there was added \JSON_THROW_ON_ERROR flag to json_decode function, so our code is broken because json column can contain null:

    In JsonType.php line 32:
                    
      Syntax error  
    

    Impossible to migrate to v2, because current php version is 7.4. We are working on migration...

    Changelog

    
    ### Fixed
    - JsonType::convertToPHPValue and JsonType::convertToDatabaseValue can return null 
    
    patch 
    opened by dmitryuk 6
  • Implements TransactionalManagerInterface

    Implements TransactionalManagerInterface

    Implements TransactionalManagerInterface and Use in SnapshotManagerInterface

    This idea was raised in this PR: sonata-project/SonataPageBundle#1548

    • Create test for Create and cleanup snapshots, to make sure that beginTransaction and commit methods are called
    feature 
    opened by eerison 6
Releases(1.18.1)
Owner
Sonata Project
Symfony bundles on steroids
Sonata Project
Zephir is a compiled high level language aimed to the creation of C-extensions for PHP.

Zephir - is a high level programming language that eases the creation and maintainability of extensions for PHP. Zephir extensions are exported to C c

Zephir Language 3.2k Jan 2, 2023
GitHub action to set up PHP with extensions, php.ini configuration, coverage drivers, and various tools.

GitHub action to set up PHP with extensions, php.ini configuration, coverage drivers, and various tools.

Shivam Mathur 2.4k Jan 6, 2023
Custom code snippets and examples for SkyVerge-built WooCommerce extensions

SkyVerge WooCommerce Plugins Welcome to the wc-plugins-snippets repository! This repository stores code snippets related to SkyVerge WooCommerce plugi

SkyVerge 255 Nov 16, 2022
Library to build PHP extensions with C++

PHP-CPP The PHP-CPP library is a C++ library for developing PHP extensions. It offers a collection of well documented and easy-to-use classes that can

Copernica 1.3k Dec 24, 2022
PhpCodeAnalyzer scans codebase and analyzes which non-built-in php extensions used

PhpCodeAnalyzer PhpCodeAnalyzer finds usage of different non-built-in extensions in your php code. This tool helps you understand how transportable yo

Sergey 92 Oct 19, 2022
Silverstripe-ideannotator - Generate docblocks for DataObjects, Page, PageControllers and (Data)Extensions

silverstripe-ideannotator This module generates @property, @method and @mixin tags for DataObjects, PageControllers and (Data)Extensions, so ide's lik

SilverLeague 44 Dec 21, 2022
Modularize extensions using symlinks. Voted #1 Magento tool by @WebShopApps!

modman (Module Manager) Developing extensions for software that doesn't allow you to separate your files from core files, and keeping that extension u

Colin Mollenhour 731 Dec 29, 2022
A Magento 2 dashboard to display installed extensions. Read the blog post on some of the thinking behind it:

Extension Dashboard for Magento 2 This module adds a dashboard to review all installed extensions in the Magento admin (Magento 2.3.0+ for now only).

ExtDN 36 Dec 24, 2022
GitHub Actions for Magento 2 Extensions

GitHub Actions for Magento 2 Extensions This repository's aim is to provide a set of open sourced GitHub actions to write better tested Magento 2 exte

ExtDN 104 Jan 1, 2023
List of Magento extensions with known security issues.

Magento Vulnerability Database List of Magento 1 and 2 integrations with known security issues. Objective: easily identify insecure 3rd party software

Sansec 184 Dec 7, 2022
A simple script to convert extensions from Magento1 to Magento2

ConvertM1M2 Background The purpose of this script is to automate as much as possible the initial conversion of a Magento 1 extension, and allow develo

Boris Gurvich 144 Dec 14, 2022
Dubbox now means Dubbo eXtensions, and it adds features like RESTful remoting, Kyro/FST serialization, etc to the Dubbo service framework.

Dubbox now means Dubbo eXtensions. If you know java, javax and dubbo, you know what dubbox is :) Dubbox adds features like RESTful remoting, Kyro/FST

当当 4.9k Dec 27, 2022
This library uses GD and EXIF (optional) PHP extensions so make sure you have them installed.

simple and fast image processing class that can downscale, compress and convert images using php-gd native functions

Leon 8 Jul 15, 2022
PhpCodeAnalyzer scans codebase and analyzes which non-built-in php extensions used

PhpCodeAnalyzer PhpCodeAnalyzer finds usage of different non-built-in extensions in your php code. This tool helps you understand how transportable yo

Sergey 89 Jan 14, 2022
Doctrine extensions for PHPStan

Doctrine extensions for PHPStan PHPStan Doctrine This extension provides following features: DQL validation for parse errors, unknown entity classes a

PHPStan 478 Jan 3, 2023
Twig extensions for common navigation widgets for symfony.

Twig Navigation Extension This bundle provides a Twig extensions for common navigation widgets. Installation composer require m2mtech/twig-navigation-

Martin Mandl 1 Feb 23, 2022
This project backports features found in the latest PHP versions and provides compatibility layers for some extensions and functions

This project backports features found in the latest PHP versions and provides compatibility layers for some extensions and functions. It is intended to be used when portability across PHP versions and extensions is desired.

Symfony 2.2k Dec 29, 2022
This extensions makes it possible to modify the TCA of container children elements

This extensions makes it possible to modify the TCA of container children elements

Georg Ringer 6 Oct 24, 2022
Allows installing Drupal extensions event if not compatible with installed drupal/core package

mglaman/composer-drupal-lenient Lenient with it, Drupal 10 with it. Why? The Drupal community introduced a lenient Composer facade that modified the d

Matt Glaman 14 Dec 18, 2022