DBIx-QuickORM
view release on metacpan or search on metacpan
worktrees/audit-fixes-master/lib/DBIx/QuickORM/Join/Row.pm view on Meta::CPAN
#>>>
#####################
# {{{ Sanity Checks #
#####################
=pod
=head1 PUBLIC METHODS (sanity checks)
=over 4
=item $row = $row->check_sync
Run C<check_sync> on every sub-row and return self.
=back
=cut
sub check_sync { $_[0]->_row_map(sub { $b->check_sync }); $_[0] }
#####################
# }}} Sanity Checks #
#####################
############################
# {{{ Manipulation Methods #
############################
=pod
=head1 PUBLIC METHODS (manipulation)
=over 4
=item $row->update
=item $row->insert
=item $row->insert_or_save
Not implemented for join rows; these croak.
=item $row = $row->force_sync
=item $row = $row->discard
=item $row = $row->refresh
=item $row = $row->save
=item $row = $row->delete
Apply the operation to every sub-row and return self.
=back
=cut
sub update {
my $self = shift;
croak "Not Implemented";
}
sub insert {
my $self = shift;
croak "Not Implemented";
}
sub insert_or_save {
my $self = shift;
croak "Not Implemented";
}
#<<<
sub force_sync { $_[0]->_row_map(sub {$b->force_sync}); $_[0] }
sub discard { $_[0]->_row_map(sub {$b->discard }); $_[0] }
sub refresh { $_[0]->_row_map(sub {$b->refresh }); $_[0] }
sub save {
my $self = shift;
# Save foreign-key parents before children (deterministic, not hash order).
for my $as (@{$self->source->save_order}) {
my $row = $self->{+BY_ALIAS}->{$as} or next;
$row->save;
}
return $self;
}
sub delete {
my $self = shift;
# Delete children before parents (reverse of the save order).
for my $as (reverse @{$self->source->save_order}) {
my $row = $self->{+BY_ALIAS}->{$as} or next;
$row->delete;
}
return $self;
}
#>>>
############################
# }}} Manipulation Methods #
############################
#####################
# {{{ Field methods #
#####################
=pod
=head1 PUBLIC METHODS (fields)
=over 4
=item $value = $row->field($proto, ...)
=item $value = $row->raw_field($proto, ...)
=item $value = $row->stored_field($proto, ...)
=item $value = $row->pending_field($proto, ...)
( run in 1.091 second using v1.01-cache-2.11-cpan-600a1bdf6e4 )