Not a developer? Go to


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' });

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.