Giter Club home page Giter Club logo

sonata-doctrine-extensions's Introduction

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
2.x Test Coverage Status
3.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.

sonata-doctrine-extensions's People

Contributors

bladrak avatar core23 avatar dmaicher avatar dmitryuk avatar eerison avatar esserj avatar franmomu avatar greg0ire avatar jordisala1991 avatar kunicmarko20 avatar mazsudo avatar mremi avatar oskarstark avatar petk avatar phansys avatar rande avatar sad270 avatar seferov avatar skydiablo avatar sonataci avatar soullivaneuh avatar vanphucvo avatar vincentlanglet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sonata-doctrine-extensions's Issues

dependency on a non-existent service "sonata.doctrine.adapter.doctrine_phpcr".

All

Sonata packages

$ composer show --latest 'sonata-project/*'
sonata-project/admin-bundle              3.74.0 3.74.0 The missing Symfony Admin Generator
sonata-project/block-bundle              4.3.0  4.3.0  Symfony SonataBlockBundle
sonata-project/cache                     2.0.1  2.0.1  Cache library
sonata-project/doctrine-extensions       1.9.1  1.9.1  Doctrine2 behavioral extensions
sonata-project/doctrine-orm-admin-bundle 3.21.0 3.21.0 Symfony Sonata / Integrate Doctrine ORM into the SonataAdminBundle
sonata-project/exporter                  2.3.0  2.3.0  Lightweight Exporter library
sonata-project/form-extensions           1.6.0  1.6.0  Symfony form extensions
sonata-project/twig-extensions           1.4.1  1.4.1  Sonata twig extensions

PHP version

$ php -v
PHP 7.4.8 (cli) (built: Jul 22 2020 09:39:30) ( NTS )

Subject

Sonata assumes that the extension sonata.doctrine.adapter.doctrine_phpcr is present.

# I use sonata with doctrine orm. 
I installed phpcr for another package. So the service `doctrine_phpcr` exists.
Now sonata tries to load the `sonata.doctrine.adapter.doctrine_phpcr` that does not exist.

-->

Steps to reproduce

  1. Install sonata admin with doctrine orm.
  2. add doctrine/phpcr-bundle

Expected results

sonata will check sonata.doctrine.adapter.doctrine_phpcr before adding as adapter

Actual results

sonata does not check sonata.doctrine.adapter.doctrine_phpcr before adding as adapter

Error message

The service "sonata.doctrine.model.adapter.chain" has a dependency on a non-existent service "sonata.doctrine.adapter.doctrine_phpcr".

Include JsonType in Doctrine core

This repository is very small, it contains only one doctrine type. We could remove this repo if JsonType is accepted in Doctrine core.

Has it already been discussed ? Does someone have an idea if JsonType would be accepted in the doctrine core ?

Issue with core-bundle twig dependency

Environment

Ubuntu 14.04

Sonata packages

DoctrineORMAdminBundle
CoreBundle
BlockBundle


sonata-project/admin-bundle              3.42.2 3.42.2 The missing Symfony Admin Generator
sonata-project/block-bundle              3.13.0 3.13.0 Symfony SonataBlockBundle
sonata-project/cache                     2.0.1  2.0.1  Cache library
sonata-project/core-bundle               3.13.2 3.13.2 Symfony SonataCoreBundle
sonata-project/datagrid-bundle           2.4.0  2.4.0  Symfony SonataDatagridBundle
sonata-project/doctrine-extensions       1.1.2  1.1.2  Doctrine2 behavioral extensions
sonata-project/doctrine-orm-admin-bundle 3.6.3  3.6.3  Symfony Sonata / Integrate Doctrine ORM into the SonataAdminBundle
sonata-project/exporter                  1.10.0 1.10.0 Lightweight Exporter library

Symfony packages

symfony/monolog-bundle     v3.3.1  v3.3.1  Symfony MonologBundle
symfony/phpunit-bridge     v3.4.20 v4.2.1  Symfony PHPUnit Bridge
symfony/polyfill-apcu      v1.10.0 v1.10.0 Symfony polyfill backporting apcu_* functions to lower PHP versions
symfony/polyfill-ctype     v1.10.0 v1.10.0 Symfony polyfill for ctype functions
symfony/polyfill-intl-icu  v1.10.0 v1.10.0 Symfony polyfill for intl's ICU-related data and classes
symfony/polyfill-mbstring  v1.10.0 v1.10.0 Symfony polyfill for the Mbstring extension
symfony/polyfill-php56     v1.10.0 v1.10.0 Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions
symfony/polyfill-php70     v1.10.0 v1.10.0 Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions
symfony/polyfill-util      v1.10.0 v1.10.0 Symfony utilities for portability of PHP codes
symfony/security-acl       v3.0.1  v3.0.1  Symfony Security Component - ACL (Access Control List)
symfony/swiftmailer-bundle v2.6.7  v3.2.4  Symfony SwiftmailerBundle
symfony/symfony            v3.4.20 v4.2.1  The Symfony PHP framework

PHP version

PHP 7.1.24-1+ubuntu14.04.1+deb.sury.org+1 (cli) (built: Nov 12 2018 09:43:03) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.1.24-1+ubuntu14.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
    with Xdebug v2.6.1, Copyright (c) 2002-2018, by Derick Rethans

Subject

TemplateExtension Problem

Actual results

Type error: Argument 3 passed to Sonata\Twig\Extension\TemplateExtension::__construct() must be an instance of Sonata\CoreBundle\Model\Adapter\AdapterInterface, instance of Sonata\Doctrine\Adapter\AdapterChain given, called in /home/gdaly/sonata/var/cache/dev/ContainerNlmkxbh/appDevDebugProjectContainer.php on line 2592

Make OptionsBuilder methods explicit

There is only one method OptionsBuilder::add method to create a doctrine mapping. This signature requires you to know the technical details.

I would expect more specific names, which are more developer friendly.

  • OptionsBuilder::createManyToMany
  • OptionsBuilder::mapField
  • OptionsBuilder::addOrder
  • OptionsBuilder::addJoin
  • OptionsBuilder::clearOrder
  • ...

Add support for doctrine/persistence 3

Feature Request

Currently blocked by

doctrine/mongodb-odm                2.3.3    requires  doctrine/persistence (^2.2)          
doctrine/phpcr-odm                  1.6.0    requires  doctrine/persistence (^1.3.7 || ^2.0)          
symfony/doctrine-bridge             v6.0.7   requires  doctrine/persistence (^2)  

For mongodb-odm, it will be in the 2.4.0 doctrine/mongodb-odm#2419
For symfony too: https://github.com/symfony/doctrine-bridge/blob/5.4/composer.json#L21
But I don't know if https://github.com/doctrine/phpcr-odm will support persistence 3 ; there is not a lot of activity.

@jordisala1991, should we

  1. Deprecate the phpcr-odm support
  2. Remove the phpcr-odm dependency from require-dev
  3. Defining it as a variant https://github.com/sonata-project/dev-kit/blob/master/config/projects.yaml#L38

Or do you see another solution ?

cannot mock the final protected function getRepository()

Hi

I want to write unit test for a method in my manager that extends the BaseEntityManager
I use getRepository to make a query then I have some business logic for a result which is get from the query, before the result is returned.

I just want to test my business logic so I mock the getRepository() (because the returned result from the query does not matter for me in that case)
But the php unit is not able to do that because of the final modifier

Can we remove the that final modifier ?

Add documentation

Feature Request

We need some basic docs what this library does and how it works.

Remove ORM related function to agnostic interfaces

Feature Request

ManagerInterface has two methods that seem to only be useful to the ORM implementation:

/**
* Get the related table name.
*
* @return string
*/
public function getTableName();
/**
* Get the DB driver connection.
*
* @return Connection
*/
public function getConnection();

In the abstract BaseManager, the getTableName method is implemented:

public function getTableName()
{
return $this->getObjectManager()->getClassMetadata($this->class)->table['name'];
}

But ClassMetadata::$name is only available in the ORM ClassMetadata.

So it would be nice to deprecated them.

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?

Issue with sonata-project/doctrine-extensions version 1.1.4

Environment

dev

Sonata packages

$ composer show --latest 'sonata-project/*'
sonata-project/admin-bundle              3.45.1 3.45.1 The missing Symfony Admin Generator
sonata-project/block-bundle              3.14.0 3.14.0 Symfony SonataBlockBundle
sonata-project/cache                     2.0.1  2.0.1  Cache library
sonata-project/core-bundle               3.14.1 3.14.1 Symfony SonataCoreBundle
sonata-project/datagrid-bundle           2.4.0  2.4.0  Symfony SonataDatagridBundle
sonata-project/doctrine-extensions       1.1.4  1.1.4  Doctrine2 behavioral extensions
sonata-project/doctrine-orm-admin-bundle 3.7.0  3.7.0  Symfony Sonata / Integrate Doctrine ORM into the SonataAdminB...
sonata-project/easy-extends-bundle       2.5.0  2.5.0  Symfony SonataEasyExtendsBundle
sonata-project/exporter                  1.11.0 2.0.0  Lightweight Exporter library
sonata-project/google-authenticator      2.2.0  2.2.0  Library to integrate Google Authenticator into a PHP project
sonata-project/user-bundle               4.2.3  4.2.3  Symfony SonataUserBundle

Symfony packages

$ composer show --latest 'symfony/*'
symfony/monolog-bundle     v3.3.1  v3.3.1  Symfony MonologBundle
symfony/phpunit-bridge     v3.4.21 v4.2.2  Symfony PHPUnit Bridge
symfony/polyfill-apcu      v1.10.0 v1.10.0 Symfony polyfill backporting apcu_* functions to lower PHP versions
symfony/polyfill-ctype     v1.10.0 v1.10.0 Symfony polyfill for ctype functions
symfony/polyfill-intl-icu  v1.10.0 v1.10.0 Symfony polyfill for intl's ICU-related data and classes
symfony/polyfill-mbstring  v1.10.0 v1.10.0 Symfony polyfill for the Mbstring extension
symfony/polyfill-php56     v1.10.0 v1.10.0 Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions
symfony/polyfill-php70     v1.10.0 v1.10.0 Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions
symfony/polyfill-util      v1.10.0 v1.10.0 Symfony utilities for portability of PHP codes
symfony/security-acl       v3.0.1  v3.0.1  Symfony Security Component - ACL (Access Control List)
symfony/swiftmailer-bundle v3.2.5  v3.2.5  Symfony SwiftmailerBundle
symfony/symfony            v3.4.21 v4.2.2  The Symfony PHP framework

PHP version

$ php -v
PHP 7.2.10-0ubuntu1 (cli) (built: Sep 13 2018 13:38:55) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.10-0ubuntu1, Copyright (c) 1999-2018, by Zend Technologies

Subject

On update "sonata-project/doctrine-extensions" to version "1.1.4" symfony throw error with JsonType.php, if i comment the line of "declare(strict_types=1);" works perfectly.

jsonerror

Excuse me for my english

Steps to reproduce

Symfony 3.4.21 with oci8 driver for oracle db 11g
try login

Expected results

Actual results

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.