有 User 和 UserProfile 模型。用户模型与 UserProfile 具有 hasOne 关联。UserProfile mysql 表为空。当我执行 $this->User->find('all', array('contain' => array('UserProfile'))) 而不是空的 UserProfile 数组时,如您所料,我得到一个填充了空的数组与架构对应的字段:
大批 ( [0] => 数组 ( [用户] => 数组 ( [id] => 1 [名字] => 乔 [姓氏] => 博客 [电子邮件] => katie.barnes@scotlandsdna.com [密码] => $2a$10$re4r7AXWQcXgkKcabUqmtO6j.7p2bA1t2SLeG93eVsiDPBgGaeXRS [启用] => 1 [user_group_id] => 1 [创建] => 2014-06-26 15:01:38 [修改] => 2014-06-26 15:01:38 ) [用户配置文件] => 数组 ( [身份证] => [职位名称] => [user_id] => [启用] => [创建] => [修改] => ) )
任何人都看过这个并且知道如何解决它?!