Gideon
view release on metacpan or search on metacpan
lib/Gideon/Driver.pm view on Meta::CPAN
$driver->_find( $target, \%query, $order );
}
sub find_one {
my ( $driver, $target, %query ) = @_;
my $order = delete $query{-order};
$driver->_find( $target, \%query, $order, 1 )->[0];
}
sub update {
my ( $driver, $target, %changes ) = @_;
my $is_object = ref $target;
Gideon::Exception::ObjectNotInStore->throw
if $is_object and not $target->__is_persisted;
my $result =
$is_object
? $driver->_update_object( $target, \%changes )
lib/Gideon/Plugin.pm view on Meta::CPAN
sub find_one {
my $self = shift;
$self->next->find_one(@_);
}
sub find {
my $self = shift;
$self->next->find(@_);
}
sub update {
my $self = shift;
$self->next->update(@_);
}
sub save {
my $self = shift;
$self->next->save(@_);
}
sub remove {
lib/Gideon/Plugin/StrictMode.pm view on Meta::CPAN
my $strict_mode = delete $query{-strict};
my $result = $self->next->find_one( $target, %query );
if ( $strict_mode and not defined $result ) {
Gideon::Exception::NotFound->throw;
}
$result;
}
sub update {
my ( $self, $target, %changes ) = @_;
my $strict_mode = delete $changes{-strict};
my $result = $self->next->update( $target, %changes );
if ( $strict_mode and not $result ) {
Gideon::Exception::UpdateFailure->throw;
}
$result;
( run in 0.476 second using v1.01-cache-2.11-cpan-4d4bc49f3ae )