pkg('List') - interface to manage lists.
use Krang::ClassLoader 'List';
# create and save new list in Krang::ListGroup 2
my $list = pkg('List')->new( name => 'list1',
list_group_id => 2,
);
$list->save();
# create new list in same group with first list as parent
my $list2 = pkg('List')->new( name => 'list2',
list_group_id => 2,
parent_list_id => $list->list_id );
$list2->save();
# find and return lists in Krang;:ListGroup 2
my @found = pkg('List')->find( list_group_id => 2 );
# delete them both
$list->delete;
$list2->delete;
This class handles management of krang lists. Each list must be a member of a Krang::ListGroup, and may optionally have another Krang::List as a parent.
The actual contents of a list is handles by Krang::ListItem.
Currently, krang lists should only be created via load on database make as configured in an ElementSet's lists.conf file.
new()save()find()Supported keys:
delete()$list = Krang::List->deserialize_xml(xml => $xml, set => $set, no_update => 0)If a matching list (same name, list_group_id, parent_list_id) exists, it will not be updated, but it wil not be replicated either.
Krang::ListGroup, Krang::ListItem, Krang::ElementClass::ListGroup, The Krang Element System