FullCalendarBundle обрабатывает ошибку события в symfony 3.4 - PullRequest
0 голосов
/ 03 мая 2020

Я установил fullcalendarbundle и настроил его так, как указано на Github https://github.com/tattali/CalendarBundle/blob/master/src/Resources/doc/doctrine-crud.md#3 -create-the-crud , я могу отобразить календарь. Но когда я пытаюсь создать календарь событий. У меня ошибка

The "AppBundle\Repository\CalendarEventsRepository" entity repository implements "Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepositoryInterface", but its service could not be found. Make sure the service exists and is tagged with "doctrine.repository_service". 

Вот мой репозиторий

<?php
namespace AppBundle\Repository;
use AppBundle\Entity\CalendarEvents;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Symfony\Bridge\Doctrine\RegistryInterface;
class CalendarEventsRepository extends ServiceEntityRepository
{
    public function __construct(RegistryInterface $registry)
    {
        parent::__construct($registry, CalendarEvents::class);
    }
}

Мой services.yml настроен так:

parameters:
services:
  #default configuration for services in *this* file

    _defaults:
        autowire: true
        autoconfigure: true
        public: false

    AppBundle\:
        resource: '../../src/AppBundle/*'
        exclude: '../../src/AppBundle/{Entity,Repository,Tests}'

    AppBundle\Controller\:
        resource: '../../src/AppBundle/Controller'
        public: true
        tags: ['controller.service_arguments']


   # AppBundle\Service\ExampleService:
   #   arguments:
   #          $someArgument: 'some_value'
   #   AppBundle\Twig\PlanningExtension:
   #         tags: ['twig.extension']
   # adding the required tag to all repository services

   #AppBundle\Repository\CalendarEventsRepository:
   #   arguments:
   #      - '@doctrine.orm.entity_manager'
   #      - '@=service("doctrine.orm.entity_manager").getClassMetadata("AppBundle\\Entity\\CalendarEvents")'
   #   tags:
        # - { name: doctrine.repository_service }

Я на symfony 3.4 , Я искал несколько решений без успеха, если у вас есть решение. Я буду рад, что вы поможете мне.

1 Ответ

0 голосов
/ 04 мая 2020

Если вы хотите автоматически связывать репозитории, измените параметр exclude:

AppBundle\:
    resource: '../../src/AppBundle/*'
    exclude: '../../src/AppBundle/{Entity,Repository,Tests}'

... определяет: автоматическое связывание всего в src/AppBundle, кроме тех классов в подпапках Entity, Repository, и Tests. Удаляя Repository из этого списка, вы разрешаете автопроводку для своих репозиториев

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...