File: Item.pm

package info (click to toggle)
libipc-pubsub-perl 0.29-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 176 kB
  • sloc: perl: 1,471; makefile: 2
file content (37 lines) | stat: -rw-r--r-- 725 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package IPC::PubSub::Cache::JiftyDBI::Stash::Item;
use strict;
use warnings;

use vars qw/$TABLE_PREFIX/;

use Jifty::DBI::Schema;
use Jifty::DBI::Record schema {
    column data_key    => type is 'text';
    column val    => type is 'blob', filters are 'Jifty::DBI::Filter::Storable';
    column expiry => type is 'int';
};


sub table_prefix {
    my $self = shift;
    $TABLE_PREFIX = shift if (@_);
    return ($TABLE_PREFIX);
}

sub table {
    my $self = shift;
    return $self->table_prefix . $self->SUPER::table();
}


package IPC::PubSub::Cache::JiftyDBI::Stash::ItemCollection;
use base qw/Jifty::DBI::Collection/;

sub table {
    my $self = shift;
    my $tab = $self->new_item->table();
    return $tab;
}


1;