[Dbix-class] in_storage and cascade delete

Richard Jolly richardjolly at mac.com
Wed Mar 15 20:27:00 CET 2006


Hi,

$obj->in_storage is not correct if the object has been deleted by a 
cascade delete. Is that a problem? I'm not sure how you could guarantee 
that in_storage is always correct, baring doing a find().

# Foo has_many Bars

$f = $schema->resultset('Foo')->create(...);
$b = $schema->resultset('Bar')->create(...);

$b->foo( $f );
$b->update;

$f->delete;

$schema->resultset('Foo')->count; # 0
$schema->resultset('Bar')->count; # 0

$b->in_storage; # 1

Richard




More information about the Dbix-class mailing list