Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/symfony/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/meteor/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Symfony Hautelook Alice:未加载自定义处理器_Symfony_Nelmio Alice_Alice Fixtures - Fatal编程技术网

Symfony Hautelook Alice:未加载自定义处理器

Symfony Hautelook Alice:未加载自定义处理器,symfony,nelmio-alice,alice-fixtures,Symfony,Nelmio Alice,Alice Fixtures,使用hautelook/alice捆绑包时无法加载自定义处理器 在my services.yml中: alice.processor.attendance: class: MyVendor\MyBundle\DataFixtures\Processor\AttendanceProcessor arguments: [ "@doctrine.orm.my_entity_manager","@doctrine.orm.second_entity_manager" ] tags

使用hautelook/alice捆绑包时无法加载自定义处理器

在my services.yml中:

alice.processor.attendance:
    class: MyVendor\MyBundle\DataFixtures\Processor\AttendanceProcessor
    arguments: [ "@doctrine.orm.my_entity_manager","@doctrine.orm.second_entity_manager" ]
    tags: [ { name: hautelook_alice.alice.processor } ]
MyVendor/MyBundle中的我的文件夹结构:

DataFixtures
    | Faker
    | ORM
       | attendance.yml
       | AppFixtures.php
    | Processor
       | AttendanceProcessor.php
在AttendanceProcessor.php中:

<?php

namespace MyVender\MyBundle\DataFixtures\Processor;

use Nelmio\Alice\ProcessorInterface;
use Isha\HRBundle\Entity\Attendance;

class AttendanceProcessor implements ProcessorInterface
{
    protected $em;
    protected $suvyaEm;

    public function __construct($suvyaEm,$em)
    {
        var_dump("hello3");
        die();
        $this->em = $em;
        $this->suvyaEm = $suvyaEm;
    }

    /**
     * {@inheritdoc}
     */
    public function preProcess($object)
    {
        var_dump("hello1");

        if (false === $object instanceof Attendance) {
            return;
        }

        var_dump("hello1");
        die();
    }

    /**
     * {@inheritdoc}
     */
    public function postProcess($object)
    {
        var_dump("hello2");
        die();
    }
}

服务标签似乎在某个点上发生了变化,当我设置标签时,它对我有效
fidry\u alice\u data\u fixtures.processor

alice.processor.attendance: class: MyVendor\MyBundle\DataFixtures\Processor\AttendanceProcessor arguments: [ "@doctrine.orm.my_entity_manager","@doctrine.orm.second_entity_manager" ] tags: [ { name: fidry_alice_data_fixtures.processor } ] alice.processor.Attention: 类别:MyVendor\MyBundle\DataFixtures\Processor\AttendanceProcessor 参数:[“@doctrine.orm.my_entity_manager”,“@doctrine.orm.second_entity_manager”] 标记:[{name:fidry\u alice\u data\u fixtures.processor}] alice.processor.attendance: class: MyVendor\MyBundle\DataFixtures\Processor\AttendanceProcessor arguments: [ "@doctrine.orm.my_entity_manager","@doctrine.orm.second_entity_manager" ] tags: [ { name: fidry_alice_data_fixtures.processor } ]