xtgss007 / qeephp

Automatically exported from code.google.com/p/qeephp
0 stars 0 forks source link

ActiveRecord 的 belongs to 关联应该可以指定为可选 #89

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
当 belongs to 
关联为可选时,对应的关联字段值将被设置为默认值(0)。�
��认值可
以由开发者在定义关联时指定。

Original issue reported on code.google.com by dualf...@gmail.com on 16 Sep 2008 at 2:49

GoogleCodeExporter commented 9 years ago
is good idea!

Original comment by jerry2...@gmail.com on 20 Feb 2009 at 10:30

GoogleCodeExporter commented 9 years ago
确实,整好遇到这个问题,我的用户详细信息(Memberfield)属
于某个城市(City),设置为:
                'city' => array(
                    QDB::BELONGS_TO     => 'City',
                    'source_key'        => 'cid',
                    'skip_empty'        => true,
                ),
即可

Original comment by hmec...@gmail.com on 28 Dec 2010 at 8:32