Apache-iNcom

 view release on metacpan or  search on metacpan

lib/DBIx/SearchProfiles.pm  view on Meta::CPAN


    $self->sql_do( $statement, @values );
}

=pod

=head2 record_update ( $name, \%params );

This method will update a record in the table specified by the profile
$name. The I<params> argument is a reference to an hash which contains
the record data to be updated. The hash should contains one element
for each key specified in the I<keys> field of the profile. Each
elements in the fields that is a valid table fields (as specified by
the I<fields> element of the profile) will be updated. Any elements
specified I<defaults> and not present in the I<params> hash will also
be updated.

Return value is undefined.

=cut

sub record_update {
    my $self = shift;
    my $name = shift;
    my $fdat = shift || {};

lib/DBIx/SearchProfiles.pm  view on Meta::CPAN

    $self->sql_do( $statement_spec, @params );
}

=pod

=head2 template_update ( $name, params )

This method will update records according to the profile $name and
using standard template's placholders substitutions semantics.

Return value is the number of rows updated.

=cut

sub template_update {
    my $self = shift;
    my $name = shift;

    my ( $fdat, @params );

    # Params is either an hash ref in which we will look

lib/DBIx/UserDB.pm  view on Meta::CPAN

    if ( not ref $whom) {
	$rv = $DB->sql_update( q{ UPDATE default_acl SET negated = ?
				  WHERE target = ? AND privilege = ? },
			       $negated, $target, $priv );
    } elsif ( exists $whom->{uid} ) {
	$rv = $DB->sql_update( q{ UPDATE user_acl SET negated = ?
				  WHERE uid = ? AND target = ?
					AND privilege = ? },
			       $negated, $whom->{uid}, $target, $priv );
    } else {
	$rv = $DB->sql_updated( q{ UPDATED group_acl SET negated = ?
				   WHERE gid = ? AND target = ?
					 AND privilege = ? },
			 $negated, $whom->{gid}, $target, $priv );
    }
    unless ( $rv ) {
	if ( not ref $whom) {
	    $DB->sql_insert( q{ INSERT INTO default_acl
				    (target,privilege,negated)
				    VALUES (?,?,?) },
			     $target, $priv, $negated );



( run in 0.271 second using v1.01-cache-2.11-cpan-05444aca049 )