Giter VIP home page Giter VIP logo

Comments (12)

dominikzogg avatar dominikzogg commented on June 30, 2024 1

Hello @dsoms

Adding the registry after require the $loader is perfect.
Use the version ~1.0 of my validator, its for silex ~1.0

Regards dominikzogg

from dflydev-doctrine-orm-service-provider.

dominikzogg avatar dominikzogg commented on June 30, 2024

Hello @dsoms

One things, is the error, it seems the annotation is not loadable. There are to common reasons for this. First the annotation class is not available (did you installed symfony/validatior), the second the annotation registry is missing.

https://github.com/dflydev/dflydev-doctrine-orm-service-provider#why-arent-my-annotations-classes-being-found

To get annotation validation running you need something like this:

https://github.com/saxulum/saxulum-validator-provider

Regards @dominikzogg

from dflydev-doctrine-orm-service-provider.

dsoms avatar dsoms commented on June 30, 2024

Hello @dominikzogg

1- symfony/validatior is installed

composer.json

{
    "name": "fabpot/silex-skeleton",
    "description": "A pre-configured skeleton for the Silex microframework",
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.3.3",
        "silex/silex": "~1.0",
        "silex/web-profiler": "~1.0",
        "symfony/browser-kit": "~2.3",
        "symfony/class-loader": "~2.3",
        "symfony/config": "~2.3",
        "symfony/console": "~2.3",
        "symfony/css-selector": "~2.3",
        "symfony/debug": "~2.3",
        "symfony/finder": "~2.3",
        "symfony/form": "~2.3",
        "symfony/monolog-bridge": "~2.3",
        "symfony/process": "~2.3",
        "symfony/security": "~2.3",
        "symfony/translation": "~2.3",
        "symfony/twig-bridge": "~2.3",
        "symfony/validator": "~2.3",
        "doctrine/dbal": "2.*",
        "symfony/doctrine-bridge": "2.*",
        "dflydev/doctrine-orm-service-provider": "1.0.*@dev"
    },
    "autoload": {
        "psr-0": { "": "src/" }
    },
    "extra": {
        "branch-alias": {
            "dev-master": "1.1.x-dev"
        }
    }
}

2- I think the annotation registry is missing. I installed Silex with "fabpot/silex-skeleton". Which file I have to put this code?

<?php
$loader = require __DIR__ . '/../vendor/autoload.php';

\Doctrine\Common\Annotations\AnnotationRegistry::registerLoader(array($loader, 'loadClass'));

3- I can't install saxulum-validator-provider, my Pimple version is 1.1.1 and is required >=2.1,<4

Regards @dsoms

from dflydev-doctrine-orm-service-provider.

dominikzogg avatar dominikzogg commented on June 30, 2024

If you really want to use the allready loaded doctrine bridge, take a look at: https://github.com/saxulum/saxulum-doctrine-orm-manager-registry-provider use the v2 its for silex ~1.0

from dflydev-doctrine-orm-service-provider.

dsoms avatar dsoms commented on June 30, 2024

Hi @dominikzogg

If I install the version ~1.0 of your validator, then also need the above code or I need the both?

<?php
$loader = require __DIR__ . '/../vendor/autoload.php';

\Doctrine\Common\Annotations\AnnotationRegistry::registerLoader(array($loader, 'loadClass'));

Regards @dsoms

from dflydev-doctrine-orm-service-provider.

dominikzogg avatar dominikzogg commented on June 30, 2024

@dsoms yes

from dflydev-doctrine-orm-service-provider.

dominikzogg avatar dominikzogg commented on June 30, 2024

@dsoms you need it only ones, not ones foreach annotation using lib

from dflydev-doctrine-orm-service-provider.

dsoms avatar dsoms commented on June 30, 2024

Hi @dominikzogg

It works! Thank you very much for your help!

Finally I put the code in the file "src/app.php".

Regards @dsoms

from dflydev-doctrine-orm-service-provider.

dominikzogg avatar dominikzogg commented on June 30, 2024

@dsoms your welcome, would be cool if you close the issue

from dflydev-doctrine-orm-service-provider.

dsoms avatar dsoms commented on June 30, 2024

@dominikzogg One more thing, if I like to have UniqueEntity Constraint Support within Symfony Validator Component, I need to install saxulum-doctrine-orm-manager-registry-provider and saxulum-validator-provider or only the first one?

from dflydev-doctrine-orm-service-provider.

dominikzogg avatar dominikzogg commented on June 30, 2024

@dsoms you need both

from dflydev-doctrine-orm-service-provider.

dsoms avatar dsoms commented on June 30, 2024

Hi @dominikzogg

It works too! Again, thank you very much for your help!

Issue closed.

Regards @dsoms

from dflydev-doctrine-orm-service-provider.

Related Issues (20)

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.