Removing all the children of an object
$obj->remove_children([ \%param ])
If your class has registered 'child_classes' as part of it's properties, then this method may be used to remove objects that are associated with the active object.
This method is typically used in an overridden 'remove' method.
sub remove {
my $obj = shift;
$obj->remove_children({ key => 'object_id' });
$obj->SUPER::remove(@_);
}
The 'key' parameter specified here lets you identify the field name used by
the children classes to relate back to the parent class. If unspecified,
remove_children will assume the key to be the datasource name of the
current class with an '_id' suffix.
$obj->remove_scores( \%terms, \%args );
For object classes that also have the MT::Scorable class in their
@ISA list, this method will remove any related score objects they
are associated with. This method is invoked automatically when
Class->remove or $obj->remove is invoked.
This page is part of the MT::Object Reference
Leave a note
Have a question? Please use the MT Forums. Notes submitted on documentation should pertain to tips & hints regarding documentation. Your note may be removed once its contents have been integrated into the body of the page.