<small id='kcnu8'></small><noframes id='kcnu8'>

      <legend id='kcnu8'><style id='kcnu8'><dir id='kcnu8'><q id='kcnu8'></q></dir></style></legend>
    1. <tfoot id='kcnu8'></tfoot>

    2. <i id='kcnu8'><tr id='kcnu8'><dt id='kcnu8'><q id='kcnu8'><span id='kcnu8'><b id='kcnu8'><form id='kcnu8'><ins id='kcnu8'></ins><ul id='kcnu8'></ul><sub id='kcnu8'></sub></form><legend id='kcnu8'></legend><bdo id='kcnu8'><pre id='kcnu8'><center id='kcnu8'></center></pre></bdo></b><th id='kcnu8'></th></span></q></dt></tr></i><div id='kcnu8'><tfoot id='kcnu8'></tfoot><dl id='kcnu8'><fieldset id='kcnu8'></fieldset></dl></div>
        <bdo id='kcnu8'></bdo><ul id='kcnu8'></ul>
    3. 在 Doctrine PHP Symfony 中覆盖 Doctrine_Record (sfDoctrineRecord

      时间:2024-08-09

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

            <bdo id='TuO8P'></bdo><ul id='TuO8P'></ul>
            • <tfoot id='TuO8P'></tfoot>
                <tbody id='TuO8P'></tbody>

                <small id='TuO8P'></small><noframes id='TuO8P'>

              • 本文介绍了在 Doctrine PHP Symfony 中覆盖 Doctrine_Record (sfDoctrineRecord) 实例方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我的背景是 Propel,所以我希望在 Doctrine_Record (sfDoctrineRecord) 中覆盖一个神奇的 getter 是一件简单的事情,但是我得到了一个 Segfault 或者覆盖方法被简单地忽略了超类中的一个.

                My background is in Propel, so I was hoping it would be a simple thing to override a magical getter in a Doctrine_Record (sfDoctrineRecord), but I'm getting either a Segfault or the override method is simply ignored in favor of the one in the superclass.

                https://gist.github.com/697008eaf4d7b606286a

                class FaqCategory extends BaseFaqCategory
                {
                
                  public function __toString()
                  {
                    return $this->getCategory();
                  }
                
                  // doesn't work
                  // override getDisplayName to fall back to category name if getDisplayName doesn't exist
                  public function getDisplayName() {
                
                    // also tried parent::getDisplayName() but got segfault(!)
                    if(isset($this->display_name)) {
                      $display_name = $this->display_name;
                    } else {
                      $display_name = $this->category;
                    }
                
                    return $display_name;
                
                  }
                
                }
                

                在 Doctrine_Record 实例上扩展/覆盖方法的正确 Doctrine 方法是什么(通过 sfDoctrineRecord 扩展 Doctrine_Record)?这必须是可行的...还是我应该查看模板文档?

                What is the proper Doctrine way to extend/override methods on an instance of Doctrine_Record (via sfDoctrineRecord extends Doctrine_Record)? This has to be doable...or should I be looking at the Template documentation?

                谢谢,布赖恩

                推荐答案

                试试 _get 和 _set 方法.

                Try _get and _set methods.

                这篇关于在 Doctrine PHP Symfony 中覆盖 Doctrine_Record (sfDoctrineRecord) 实例方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:Doctrine 不会更新简单的数组类型字段 下一篇:如何在 Symfony 和 Doctrine 中实现多对多和一对多?

                相关文章

              • <legend id='65UHr'><style id='65UHr'><dir id='65UHr'><q id='65UHr'></q></dir></style></legend>
                <tfoot id='65UHr'></tfoot>

                    <bdo id='65UHr'></bdo><ul id='65UHr'></ul>

                  1. <small id='65UHr'></small><noframes id='65UHr'>

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