Hi,
i have the following issue with the symfony model layer :
in my propel schema description i have something like :
<table name="foo">
<column name="id" type="integer" required="true" primaryKey="true"
autoIncrement="true" />
</table>
<table name="bar">
<column name="id" type="integer" required="true" primaryKey="true"
autoIncrement="true" />
<column name="bar_id" type="integer" required="true" />
<foreign-key foreignTable="bar">
<reference local="bar_id" foreign="id"/>
</foreign-key>
</table>
then, i can do things like : (foo can contain many bar instances)
$my_foo = new Foo();
$my_bar_1 = new Bar();
$my_bar_2 = new Bar();
...
$my_foo->addBar($my_bar_1);
$my_foo->addBar($my_bar_2);
...
$my_foo->save();
...
// here is the thing :
for each($my_foo->getBars() as $my_bar){
$my_bar->delete();
}
...
echo count($my_foo->getBars());
/*
why does it still display '2' ???
i thought i had just deleted all the 'bar' instances contained by 'my_foo'
!
*/
why does the foo instance does still contain $my_bar_1 and $my_bar_2 ?
and why does the method '$my_foo->initBars()' does't seem to do anything at
all ?
is there a way to fix that without having to retrieve the 'foo' instance
from the data source, after having deleted the 'bar' instances ?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---