~ubuntu-branches/ubuntu/saucy/libalzabo-perl/saucy

« back to all changes in this revision

Viewing changes to lib/Alzabo/Runtime/Row.pm

  • Committer: Bazaar Package Importer
  • Author(s): Gunnar Wolf, Martín Ferrari, Gunnar Wolf
  • Date: 2007-12-23 15:19:42 UTC
  • mfrom: (3.1.1 hardy)
  • Revision ID: james.westby@ubuntu.com-20071223151942-xvtszw722lpf47xx
Tags: 0.92-2
[ Martín Ferrari ]
* Added version mangle to avoid confusion between 2 digit and 4 digit minor
  versions. (Currently only affects qareport, because CPAN's by-dist only
  shows latest release, and ours is mimicked from the ls-lR file)

[ Gunnar Wolf ]
* Updated standards-version to 3.7.3 (No changes needed)

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
use Alzabo::Runtime::RowState::Deleted;
13
13
use Alzabo::Runtime::RowState::Live;
14
14
use Alzabo::Runtime::RowState::Potential;
 
15
use Alzabo::Utils;
15
16
 
16
17
use Params::Validate qw( validate validate_with UNDEF SCALAR HASHREF BOOLEAN );
17
18
Params::Validate::validation_options
102
103
 
103
104
    if ($p{where})
104
105
    {
105
 
        $p{where} = [ $p{where} ] unless UNIVERSAL::isa( $p{where}[0], 'ARRAY' );
 
106
        $p{where} = [ $p{where} ] unless Alzabo::Utils::is_arrayref( $p{where}[0] );
106
107
    }
107
108
 
108
109
    push @{ $p{where} },
246
247
    my $s = Alzabo::Runtime::Schema->load_from_file( name => delete $self->{schema} );
247
248
    $self->{table} = $s->table( delete $self->{table_name} );
248
249
 
249
 
    # If the caching system is loaded we want to return the existing
250
 
    # reference, not a copy.
251
 
    #
252
 
    # Requires a patched Storable (at least for now)
253
 
    if ( Alzabo::Runtime::UniqueRowCache->can('row_in_cache') )
254
 
    {
255
 
        if ( my $row =
256
 
             Alzabo::Runtime::UniqueRowCache->row_in_cache
257
 
                 ( $self->table->name, $self->id_as_string ) )
258
 
        {
259
 
            $_[0] = $row;
260
 
        }
261
 
    }
262
 
 
263
250
    return $self;
264
251
}
265
252