<small id='6kacL'></small><noframes id='6kacL'>

  • <tfoot id='6kacL'></tfoot>
      <bdo id='6kacL'></bdo><ul id='6kacL'></ul>

      <legend id='6kacL'><style id='6kacL'><dir id='6kacL'><q id='6kacL'></q></dir></style></legend>
      <i id='6kacL'><tr id='6kacL'><dt id='6kacL'><q id='6kacL'><span id='6kacL'><b id='6kacL'><form id='6kacL'><ins id='6kacL'></ins><ul id='6kacL'></ul><sub id='6kacL'></sub></form><legend id='6kacL'></legend><bdo id='6kacL'><pre id='6kacL'><center id='6kacL'></center></pre></bdo></b><th id='6kacL'></th></span></q></dt></tr></i><div id='6kacL'><tfoot id='6kacL'></tfoot><dl id='6kacL'><fieldset id='6kacL'></fieldset></dl></div>
      1. Doctrine:扩展实体类

        Doctrine: extending entity class(Doctrine:扩展实体类)

      2. <legend id='4qTog'><style id='4qTog'><dir id='4qTog'><q id='4qTog'></q></dir></style></legend>
        <tfoot id='4qTog'></tfoot>
        <i id='4qTog'><tr id='4qTog'><dt id='4qTog'><q id='4qTog'><span id='4qTog'><b id='4qTog'><form id='4qTog'><ins id='4qTog'></ins><ul id='4qTog'></ul><sub id='4qTog'></sub></form><legend id='4qTog'></legend><bdo id='4qTog'><pre id='4qTog'><center id='4qTog'></center></pre></bdo></b><th id='4qTog'></th></span></q></dt></tr></i><div id='4qTog'><tfoot id='4qTog'></tfoot><dl id='4qTog'><fieldset id='4qTog'></fieldset></dl></div>
                <tbody id='4qTog'></tbody>

              <small id='4qTog'></small><noframes id='4qTog'>

                • <bdo id='4qTog'></bdo><ul id='4qTog'></ul>
                  本文介绍了Doctrine:扩展实体类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想扩展 EntityBase 类,如何在 Doctrine 2.1 中做到这一点?我的研究表明,每当有人遇到这样做的问题时,他就会切换到 Doctrine 1.2 :)n 我使用的是 yaml 配置

                  I would like to extend EntityBase classes, how to do this in Doctrine 2.1? My research showed that whenever someone encounters the problem with doing this he switches to Doctrine 1.2 :)n I am using yaml configuration

                  推荐答案

                  Doctrine 2.X 实体作为 POPO(Plain Old PHP Objects)工作.为了实现正确的扩展,Doctrine 强制您使用 JPA 中称为 Mapped Super Classes 的概念.这个想法很简单.每当您想要拥有一个基类并希望您的实体从中扩展时(我不是在谈论 DB 级别的继承),您需要做的就是将基类创建为 MappedSuperClass.

                  Doctrine 2.X Entities work as POPOs (Plain Old PHP Objects). To achieve extending correctly, Doctrine enforces you to use a concept from JPA called Mapped Super Classes. The idea is pretty simple. Whenever you want to have a base class and want your entities to extend from it (I'm not talking about inheritance at DB level), all you need to do is create your Base class as a MappedSuperClass.

                  这是一个例子:http://www.doctrine-project.org/docs/orm/2.1/en/reference/inheritance-mapping.html#mapped-superclasses

                  谢谢

                  这篇关于Doctrine:扩展实体类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Proxy Authentication Required with cURL(cURL 需要代理身份验证)
                  How to use a SOCKS 5 proxy with cURL?(如何使用带有 cURL 的 SOCKS 5 代理?)
                  How to use HTTP_X_FORWARDED_FOR properly?(如何正确使用 HTTP_X_FORWARDED_FOR?)
                  file_get_contents behind a proxy?(代理后面的 file_get_contents ?)
                  pecl install cassandra throws: quot;error: Unable to load libcassandraquot;(pecl install cassandra 抛出:“错误:无法加载 libcassandra)
                  Installing php datastax driver on ubuntu(在 ubuntu 上安装 php datastax 驱动)
                    • <small id='FOcrg'></small><noframes id='FOcrg'>

                    • <tfoot id='FOcrg'></tfoot>

                    • <legend id='FOcrg'><style id='FOcrg'><dir id='FOcrg'><q id='FOcrg'></q></dir></style></legend>
                        <bdo id='FOcrg'></bdo><ul id='FOcrg'></ul>
                        <i id='FOcrg'><tr id='FOcrg'><dt id='FOcrg'><q id='FOcrg'><span id='FOcrg'><b id='FOcrg'><form id='FOcrg'><ins id='FOcrg'></ins><ul id='FOcrg'></ul><sub id='FOcrg'></sub></form><legend id='FOcrg'></legend><bdo id='FOcrg'><pre id='FOcrg'><center id='FOcrg'></center></pre></bdo></b><th id='FOcrg'></th></span></q></dt></tr></i><div id='FOcrg'><tfoot id='FOcrg'></tfoot><dl id='FOcrg'><fieldset id='FOcrg'></fieldset></dl></div>

                            <tbody id='FOcrg'></tbody>