I found the solution myself:

First of all, I had to edit plugins/sfDoctrinePlugin/config/
doctrine.yml:
 export: all

Nevertheless, my onDelete settings in my schema.yml are still not used
in the generated sql. To include the settings, they have to be
inserted into the generated classes, e.g. for a class Team, I have to
copy the setUp method from BaseTeam.class.php (as this file gets
overwritten when executing doctrine-build-model) to Team.class.php and
modify the setUp method as described in the doctrine documentation.

Link: http://doctrine.pengus.net/doctrine/manual/new/?one-page=1
(4.6.2. Integrity actions)

Running doctrine-build-sql after these changes makes my onDelete
settings work.

:-)


On 23 Jul., 16:27, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Hi!
>
> I try to migrate an application from Propel to Doctrine. Currently,
> I'm facing problems concerning the "onDelete" option.
> Using propel, I used "onDelete: restrict". sfDoctrine doesn't seem to
> support this option, does it?
>
> Next, I tried to overcome this problem by modifying the "setUp" method
> of the parent class (TeamGroup):
>
> public function setUp()
>   {
>     $this->hasMany('Team as Teams', 'Team.team_group_id' ,
> array( 'onDelete'=>'restrict'));
>   }
>
> Nevertheless, the "team_group_id" field of a Team keeps its value when
> I delete the parent object (TeamGroup).
>
> Are there any suggestions on sfDoctrine and the onDelete option?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to