0
こんにちは私はSymfony DICを使ってDoctrineを設定しています。 これはDoctrine 2.0で完璧に動作していましたが、v2.1にアップグレードしたいので、以下に示すように追加の設定を追加する必要がありました。Symfony Dependency Injection ContainerでDoctrine 2.1を設定する方法は?
$ reader = new \ Doctrine \ Common \ Annotations \ AnnotationReader();
$reader->setDefaultAnnotationNamespace('Doctrine\ORM\Mapping\\');
// new code necessary starting here
$reader->setIgnoreNotImportedAnnotations(true);
$reader->setEnableParsePhpImports(false);
私の問題もなく、上記のコードのための私のDIC構成:
<service id="doctrine.metadriver" class="Doctrine\ORM\Mapping\Driver\AnnotationDriver">
<argument type="service">
<argument type="service" id="doctrine.cache" />
<service class="Doctrine\Common\Annotations\AnnotationReader">
<call method="setDefaultAnnotationNamespace">
<argument>Doctrine\ORM\Mapping\</argument>
</call>
<call method="setIgnoreNotImportedAnnotations">
<argument>TRUE</argument>
</call>
<call method="setEnableParsePhpImports">
<argument>FALSE</argument>
</call>
</service>
</argument>
<argument>%doctrine.entity.path%</argument>
</service>
私の質問は、私はDICの設定に以下を追加することができますどのように?
$reader = new \Doctrine\Common\Annotations\CachedReader(
new \Doctrine\Common\Annotations\IndexedReader($reader), new ArrayCache()
);