Чат Telegram
Группа ВКонтакте
Новый комментарий

HardBass 19.08.2020 в 15:02

Хотел уточнить один момент.
Могу ли я из одной формы отправлять данные в две сущности? Если да, то каким образом?
То есть, если создаётся пост, сразу при создании указывать и теги, которые принадлежат посту.

artem.golovko2008@gmail.com 21.11.2020 в 13:35

Здравствуйте!

Помогите, пожалуйста.
При выполнении команды php bin/console doctrine:migrations:diff возникает ошибка

PHP Fatal error:  Cannot declare class App\Entity\Category, because the name is already in use in /home/artem/Desktop/blog/src/Entity/Category.php on line 17
PHP Stack trace:
PHP   1. {main}() /home/artem/Desktop/blog/bin/console:0
PHP   2. Symfony\Bundle\FrameworkBundle\Console\Application->run() /home/artem/Desktop/blog/bin/console:42
PHP   3. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() /home/artem/Desktop/blog/vendor/symfony/console/Application.php:149
PHP   4. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() /home/artem/Desktop/blog/vendor/symfony/framework-bundle/Console/Application.php:83
PHP   5. Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() /home/artem/Desktop/blog/vendor/symfony/console/Application.php:273
PHP   6. Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() /home/artem/Desktop/blog/vendor/symfony/framework-bundle/Console/Application.php:97
PHP   7. Doctrine\Migrations\Tools\Console\Command\DiffCommand->run() /home/artem/Desktop/blog/vendor/symfony/console/Application.php:1027
PHP   8. Doctrine\Migrations\Tools\Console\Command\DiffCommand->execute() /home/artem/Desktop/blog/vendor/symfony/console/Command/Command.php:255
PHP   9. Doctrine\Migrations\Generator\DiffGenerator->generate() /home/artem/Desktop/blog/vendor/doctrine/migrations/lib/Doctrine/Migrations/Tools/Console/Command/DiffCommand.php:145
PHP  10. Doctrine\Migrations\Generator\DiffGenerator->createToSchema() /home/artem/Desktop/blog/vendor/doctrine/migrations/lib/Doctrine/Migrations/Generator/DiffGenerator.php:84
PHP  11. Doctrine\Migrations\Provider\OrmSchemaProvider->createSchema() /home/artem/Desktop/blog/vendor/doctrine/migrations/lib/Doctrine/Migrations/Generator/DiffGenerator.php:118
PHP  12. Doctrine\ORM\Mapping\ClassMetadataFactory->getAllMetadata() /home/artem/Desktop/blog/vendor/doctrine/migrations/lib/Doctrine/Migrations/Provider/OrmSchemaProvider.php:37
PHP  13. Doctrine\Persistence\Mapping\Driver\MappingDriverChain->getAllClassNames() /home/artem/Desktop/blog/vendor/doctrine/persistence/lib/Doctrine/Persistence/Mapping/AbstractClassMetadataFactory.php:88
PHP  14. Doctrine\ORM\Mapping\Driver\AnnotationDriver->getAllClassNames() /home/artem/Desktop/blog/vendor/doctrine/persistence/lib/Doctrine/Persistence/Mapping/Driver/MappingDriverChain.php:105
PHP  15. require_once() /home/artem/Desktop/blog/vendor/doctrine/persistence/lib/Doctrine/Persistence/Mapping/Driver/AnnotationDriver.php:233
12:25:08 CRITICAL  [php] Fatal Compile Error: Cannot declare class App\Entity\Category, because the name is already in use ["exception" => Symfony\Component\ErrorHandler\Error\FatalError { …}]

In Category.php line 17:

  Compile Error: Cannot declare class App\Entity\Category, because the name is already in use 

Если что github проекта тут.

Логические задачи с собеседований