Alzabo

 view release on metacpan or  search on metacpan

lib/Alzabo/BackCompat.pm  view on Meta::CPAN

                 \&add_comment_fields,
               ],
               [ 0.71, 0.73,
                 \&convert_pk_to_array,
               ],
               [ 0.79, $Alzabo::VERSION,
                 \&add_table_attributes,
               ],
             );

sub update_schema
{
    my %p = validate( @_, { name    => { type => SCALAR },
                            version => { type => SCALAR },
                          } );

    my @cb;
    foreach my $c (@compat)
    {
        return
            if ( ( $p{version} >= $c->[0] &&

lib/Alzabo/Intro.pod  view on Meta::CPAN


  $movie->delete;

=head2 Validating data

Let's assume that we've been passed a hash of values representing an
update to the location table. Here's a way of making sure that that
this update won't lead to a loop in terms of the parent/child
relationships.

  sub update_location
  {
      my $self = shift; # this is the row object

      my %data = @_;

      if ( $data{parent_location_id} )
      {
          my $parent_location_id = $data{parent_location_id};
          my $location_t = $schema->table('Location');

lib/Alzabo/Runtime/RowState/InCache.pm  view on Meta::CPAN

        *{__PACKAGE__ . "::$meth"} =
            sub { my $s = shift;

                  $s->refresh(@_) unless $s->_in_cache(@_);

                  $s->$super(@_);
              };
    }
}

sub update
{
    my $class = shift;
    my $row = shift;

    my $old_id = $row->id_as_string;

    $class->refresh($row) unless $class->_in_cache($row);

    my $changed = $class->SUPER::update( $row, @_ );

lib/Alzabo/Runtime/RowState/Live.pm  view on Meta::CPAN

sub select_hash
{
    my $class = shift;
    my $row = shift;

    my @cols = @_ ? @_ : map { $_->name } $row->table->columns;

    return $class->_get_data( $row, @cols );
}

sub update
{
    my $class = shift;
    my $row = shift;
    my %data = @_;

    my $schema = $row->schema;

    my @fk; # this never gets populated unless referential integrity
            # checking is on
    my @set;

lib/Alzabo/Runtime/RowState/Potential.pm  view on Meta::CPAN

{
    my $class = shift;
    my $row = shift;

    my %data;
    @data{@_} = @{ $row->{data} }{@_};

    return %data;
}

sub update
{
    my $class = shift;
    my $row = shift;
    my %data = @_;

    foreach my $k (keys %data)
    {
        # This will throw an exception if the column doesn't exist.
        my $c = $row->table->column($k);

lib/Alzabo/SQLMaker.pm  view on Meta::CPAN

	    ( error => "Cannot mix actual bound values and placeholders in call to values()" );
    }

    $self->{last_op} = 'values';

    return $self;
}

use constant UPDATE_SPEC => { can => 'alias_name' };

sub update
{
    my $self = shift;

    validate_pos( @_, UPDATE_SPEC );

    my $table = shift;

    $self->{sql} = 'UPDATE ';

    $self->{sql} .= ( $self->{quote_identifiers} ?

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.499 second using v1.00-cache-2.02-grep-82fe00e-cpan-1310916c57ae )