2
usinh hautelook/alice-bundleの間にカスタムプロセッサを読み込めません。私services.ymlでHautelookアリス:カスタムプロセッサがロードされていません
:
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マイフォルダ構造:AttendanceProcessor.phpで
DataFixtures
| Faker
| ORM
| attendance.yml
| AppFixtures.php
| Processor
| 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();
}
}
AppFixtures.phpで
<?php
namespace MyVender\MyBundle\DataFixtures\ORM;
use Hautelook\AliceBundle\Doctrine\DataFixtures\AbstractLoader;
use Isha\HRBundle\DataFixtures\Processor\AttendanceProcessor;
use Nelmio\Alice\Fixtures;
class AppFixtures extends AbstractLoader
{
/**
* {@inheritDoc}
*/
public function getFixtures()
{
return array(
__DIR__ . '/attendance.yml',
);
}
}
メッセージは出力されません。