symfony

INVALID MODE : s5a869f19a6c57_equivalents - type : sonata_type_collection - mapping :

社会主义新天地 提交于 2021-02-10 20:22:52
问题 I am building a new feature onto a Symfony 2.8 application using a few Sonata bundles. My Page.php entity definition includes the following mapping: /** * @var ArrayCollection * * @ORM\ManyToMany(targetEntity="AppBundle\Entity\Equivalent", cascade={"all"}) * @ORM\JoinTable(name="page_equivalent", * joinColumns={@ORM\JoinColumn(name="page_id", referencedColumnName="id")}, * inverseJoinColumns={@ORM\JoinColumn(name="equivalent_id", referencedColumnName="id", unique=true)} * ) */ private

Symfony messenger and mailer : how to add a binding_key?

╄→尐↘猪︶ㄣ 提交于 2021-02-10 20:21:54
问题 I have a running Symfony 4.4 project with messenger and rabbitMQ. I have an async transport with 2 queues. transports: # https://symfony.com/doc/current/messenger.html#transport-configuration async: dsn: '%env(MESSENGER_TRANSPORT_DSN)%' options: exchange: name: myexchange type: direct queues: email: binding_keys: - email extranet: binding_keys: - extranet # failed: 'doctrine://default?queue_name=failed' # sync: 'sync://' routing: # Route your messages to the transports 'App\Message

INVALID MODE : s5a869f19a6c57_equivalents - type : sonata_type_collection - mapping :

好久不见. 提交于 2021-02-10 20:20:46
问题 I am building a new feature onto a Symfony 2.8 application using a few Sonata bundles. My Page.php entity definition includes the following mapping: /** * @var ArrayCollection * * @ORM\ManyToMany(targetEntity="AppBundle\Entity\Equivalent", cascade={"all"}) * @ORM\JoinTable(name="page_equivalent", * joinColumns={@ORM\JoinColumn(name="page_id", referencedColumnName="id")}, * inverseJoinColumns={@ORM\JoinColumn(name="equivalent_id", referencedColumnName="id", unique=true)} * ) */ private

API Platform returns type error instead of validation error when passing null to a string field

送分小仙女□ 提交于 2021-02-10 19:55:21
问题 I'm using API Platform v2.2.5, and in the process of writing tests for my resources I've discovered that, when null is provided for a field of type string , an error response is being returned during the denormalization process, which includes a non client-friendly message and a stack trace. This is different to if an empty string is provided or the field is omitted completely, which returns a structured validation response. How can I instead return a validation error response as when an

Symfony enable custom bundle ClassNotFoundException

一世执手 提交于 2021-02-10 14:24:12
问题 I want to install my own bundle so I did composer require "al37350/fftt-bundle": "*" Then I activated the bundle in AppKernel.php new Al\FFTTBundle\AlFFTTBundle(), But when I did a php/bin console I have this error : PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "AlFFTTBundle" from namespace "Al\FFTTBundle". Did you forget a "use" statement for another namespace? in /var/www/yoloFFTT/app/AppKernel.php:19 Stack trace: #0 /var/www

Symfony enable custom bundle ClassNotFoundException

孤街醉人 提交于 2021-02-10 14:23:09
问题 I want to install my own bundle so I did composer require "al37350/fftt-bundle": "*" Then I activated the bundle in AppKernel.php new Al\FFTTBundle\AlFFTTBundle(), But when I did a php/bin console I have this error : PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "AlFFTTBundle" from namespace "Al\FFTTBundle". Did you forget a "use" statement for another namespace? in /var/www/yoloFFTT/app/AppKernel.php:19 Stack trace: #0 /var/www

How to make LoggerInterface service public in symfony 4

白昼怎懂夜的黑 提交于 2021-02-10 14:18:57
问题 I want to have Psr\Log\LoggerInterface public in symfony to be able to get it directly from the container with $container->get('Psr\Log\LoggerInterface') . I tried the following services.yaml : _defaults: public: true Psr\Log\LoggerInterface: public: true Psr\Log\LoggerInterface: alias: 'logger' public: true Psr\Log\LoggerInterface: alias: 'monolog.logger' public: true I can not get a clue why it is so hard to rewrite a service. 回答1: As previously noted, directly accessing services from the

Symfony3 and .gitignore

眉间皱痕 提交于 2021-02-10 12:19:11
问题 I've just tried cloning a Symfony3 project from github and realised it doesn't include /bin/ (as this was not required in Symfony2). I have now updated my .gitignore to take out the /bin/ and /build/ directories to avoid this happening in future. Are there any other modifications that I'm missing that we should be making to a 'standard' Symfony3 .gitignore file? My current content is as follows now: /app/config/parameters.yml /composer.phar /vendor/ /web/bundles/ /var/ !var/cache/.gitkeep

Symfony3 and .gitignore

情到浓时终转凉″ 提交于 2021-02-10 12:18:25
问题 I've just tried cloning a Symfony3 project from github and realised it doesn't include /bin/ (as this was not required in Symfony2). I have now updated my .gitignore to take out the /bin/ and /build/ directories to avoid this happening in future. Are there any other modifications that I'm missing that we should be making to a 'standard' Symfony3 .gitignore file? My current content is as follows now: /app/config/parameters.yml /composer.phar /vendor/ /web/bundles/ /var/ !var/cache/.gitkeep

Using the same EntityListener for multiple entities with differrent service argument

做~自己de王妃 提交于 2021-02-10 07:25:51
问题 As an EntityListener is registered as a service, is it possible to register the same class multiple times with different argument and associate each of them with a particular entity ? Considering the following entities : /** * Class EntityA * @ORM\Entity * @ORM\EntityListeners({"myBundle\EventListener\SharedListener"}) */ class EntityA implements sharedBehaviourInterface { // stuff here } /** * Class EntityB * @ORM\Entity * @ORM\EntityListeners({"myBundle\EventListener\SharedListener"}) */