Doctrine 1.2.4, PHP 5.3.3, all InnoDB tables. There are three tables: profile, stream, event. Connected:
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' ));
<?php $select = new modelEvent(); $select -> merge ($data_event); $select -> modelProfile -> merge($data_profile); $select -> modelStream -> merge($data_stream); $select -> save(); ?>
Relation does not work immediately. Appears when adding the third record, and it hooks the Stream with
stream_id = 1
and
profile_id = 1
I suspect that I have made a big mistake somewhere in the documentation. Tell me where.