Symfony Hautelook Alice:未加载自定义处理器
使用hautelook/alice捆绑包时无法加载自定义处理器 在my services.yml中: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
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 } ]