Doctrine 1.2.4、PHP 5.3.3
表格配置文件、流、事件
fk:event -> 配置文件多对一
fk:event -> 流式多对一
溪流
$this->hasMany('modelEvent as Events', array(
'local' => 'id',
'foreign' => 'stream_id'
));
轮廓
$this->hasMany('modelEvent as Events', array(
'local' => 'id',
'foreign' => 'profile_id'
));
事件
$this->hasOne('modelProfile', array(
'local' => 'profile_id',
'foreign' => 'id'
));
$this->hasOne('modelStream', array(
'local' => 'stream_id',
'foreign' => 'id'
));
关系不起作用:(
<?php
$event = new modelEvent();
$event -> merge ($data_event);
$event -> modelProfile -> merge($data_profile);
$event -> modelStream -> merge($data_stream);
$event -> save();
?>