sub set_item
{
my ( $self, $item ) = @_;
return unless $item;
# when the item (DBIC row) is set, set the item_id, item_class
# and schema from the item
if( $item->id )
{ $self->item_id($item->id); }
[....]
doesn't work when the table has a column called "id" which is not the primary key or is just part of one.
$self->item_id([ map { $item->get_column($_) } $item->result_source->primary_columns ]);
would be a better solution