Overriding Doctrine_Record (sfDoctrineRecord) instance methods in Doctrine PHP Symfony

后端 未结 4 1593
滥情空心
滥情空心 2021-02-09 01:16

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 o

4条回答
  •  渐次进展
    2021-02-09 01:23

    Configure Doctrine:

    $manager->setAttribute(Doctrine::ATTR_AUTO_ACCESSOR_OVERRIDE, true); 
    

    then:

    public function getAnything()
    {
        return $this->_get('anything');
    }
    
    public function setAnything()
    {
        return $this->_set('anything', $value);
    }
    

提交回复
热议问题