简体   繁体   English

结合CodeIgniter 2和Doctrine 2 | 设置代理类

[英]Combining CodeIgniter 2 and Doctrine 2 | Setting up the proxy classes

I'm trying to get CI 2 and Doctrine 2 to work together, so far everything is going fine. 我正在尝试让CI 2和Doctrine 2一起工作,到目前为止一切都很好。 However I now have a problem concerning the Proxy classes. 但是我现在有一个关于代理类的问题。

For some reason the proxy class is looking for a mapping file, which I don't have. 由于某种原因,代理类正在寻找映射文件,而我没有。 Is this the normal behaviour? 这是正常行为吗?

The exception I get is: 我得到的异常是:

'No mapping file found named 'proxies.modelsUserProxy.dcm.xml' for class 'proxies\modelsUserProxy'.'

Do I have to write mappings myself for the proxy classes? 我是否必须为代理类编写映射? :/ :/

I'll paste some of my code here: 我将在此处粘贴一些代码:

// Proxy configuration
$config->setProxyDir(APPPATH.'proxies');
$config->setProxyNamespace('proxies');
$config->setAutoGenerateProxyClasses( TRUE );

The xml mapping in: mappings/models.User.dcm.xml xml映射在: mappings / models.User.dcm.xml

<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
                http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">

<entity name="models\User">
...
</entity>

Any information on this? 有任何信息吗?

you can find the answer on the following link (http://www.tlswebsolutions.com/codeigniter-2-and-doctrine-2-integration-a-working-setup-doctrineignited/) also, there's (http://wildlyinaccurate.com/integrating-doctrine-2-with-codeigniter-2/). 您还可以在以下链接(http://www.tlswebsolutions.com/codeigniter-2-and-doctrine-2-integration-a-working-setup-doctrineignited/)上找到答案,此外,还有(http:// wildlyinaccurate .com / integrating-doctrine-2-with-codeigniter-2 /)。

The first one, you can download a working Codeigniter2 + doctrine2. 第一个,您可以下载有效的Codeigniter2 + doctrine2。

Hope this helps ;) 希望这可以帮助 ;)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM