Doctrine 1.2.4, PHP 5.3.3
tables profile, stream, event
fk:event -> profile many-to-one
fk:event -> stream many-to-one
Stream
$this->hasMany('modelEvent as Events', array(
'local' => 'id',
'foreign' => 'stream_id'
));
Profile
$this->hasMany('modelEvent as Events', array(
'local' => 'id',
'foreign' => 'profile_id'
));
Event
$this->hasOne('modelProfile', array(
'local' => 'profile_id',
'foreign' => 'id'
));
$this->hasOne('modelStream', array(
'local' => 'stream_id',
'foreign' => 'id'
));
Relations dont work :(
<?php
$event = new modelEvent();
$event -> merge ($data_event);
$event -> modelProfile -> merge($data_profile);
$event -> modelStream -> merge($data_stream);
$event -> save();
?>