View | Details | Raw Unified | Return to bug 30920
Collapse All | Expand All

(-)a/Koha/AuthorisedValue.pm (-2 / +16 lines)
Lines 23-28 use Koha::Caches; Link Here
23
use Koha::Database;
23
use Koha::Database;
24
24
25
use base qw(Koha::Object Koha::Object::Limit::Library);
25
use base qw(Koha::Object Koha::Object::Limit::Library);
26
        
27
my $cache = Koha::Caches->get_instance();
26
28
27
=head1 NAME
29
=head1 NAME
28
30
Lines 61-74 sub store { Link Here
61
    $self = $self->SUPER::store;
63
    $self = $self->SUPER::store;
62
64
63
    if ($flush) {
65
    if ($flush) {
64
        my $cache = Koha::Caches->get_instance();
66
        my $key = "AV_descriptions:".$self->category;
65
        my $key = "AVDescriptions-".$self->category;
66
        $cache->clear_from_cache($key);
67
        $cache->clear_from_cache($key);
67
    }
68
    }
68
69
69
    return $self;
70
    return $self;
70
}
71
}
71
72
73
=head2 delete
74
75
AuthorisedValue specific C<delete> to clear relevant caches on delete.
76
77
=cut
78
79
sub delete {
80
    my $self = shift @_;
81
    my $key = "AV_descriptions:".$self->category;
82
    $cache->clear_from_cache($key);
83
    $self->SUPER::delete(@_);
84
}
85
72
=head3 opac_description
86
=head3 opac_description
73
87
74
my $description = $av->opac_description();
88
my $description = $av->opac_description();
(-)a/Koha/ClassSource.pm (-2 / +15 lines)
Lines 22-27 use Koha::Database; Link Here
22
22
23
use base qw(Koha::Object);
23
use base qw(Koha::Object);
24
24
25
my $cache = Koha::Caches->get_instance();
26
25
=head1 NAME
27
=head1 NAME
26
28
27
Koha::ClassSource - Koha Classfication Source Object class
29
Koha::ClassSource - Koha Classfication Source Object class
Lines 52-64 sub store { Link Here
52
    $self = $self->SUPER::store;
54
    $self = $self->SUPER::store;
53
55
54
    if ($flush) {
56
    if ($flush) {
55
        my $cache = Koha::Caches->get_instance();
57
        $cache->clear_from_cache('cn_sources:description');
56
        $cache->clear_from_cache('cn)sources:description');
57
    }
58
    }
58
59
59
    return $self;
60
    return $self;
60
}
61
}
61
62
63
=head2 delete
64
65
ClassSource specific C<delete> to clear relevant caches on delete.
66
67
=cut
68
69
sub delete {
70
    my $self = shift @_;
71
    $cache->clear_from_cache('cn_sources:description');
72
    $self->SUPER::delete(@_);
73
}
74
62
=head3 _type
75
=head3 _type
63
76
64
Returns name of corresponding DBIC resultset
77
Returns name of corresponding DBIC resultset
(-)a/Koha/ItemType.pm (-1 / +14 lines)
Lines 27-32 use Koha::Localizations; Link Here
27
27
28
use base qw(Koha::Object Koha::Object::Limit::Library);
28
use base qw(Koha::Object Koha::Object::Limit::Library);
29
29
30
my $cache = Koha::Caches->get_instance();
31
30
=head1 NAME
32
=head1 NAME
31
33
32
Koha::ItemType - Koha Item type Object class
34
Koha::ItemType - Koha Item type Object class
Lines 59-65 sub store { Link Here
59
    $self = $self->SUPER::store;
61
    $self = $self->SUPER::store;
60
62
61
    if ($flush) {
63
    if ($flush) {
62
        my $cache = Koha::Caches->get_instance();
63
        my $key = "itemtype:description:en";
64
        my $key = "itemtype:description:en";
64
        $cache->clear_from_cache($key);
65
        $cache->clear_from_cache($key);
65
    }
66
    }
Lines 67-72 sub store { Link Here
67
    return $self;
68
    return $self;
68
}
69
}
69
70
71
=head2 delete
72
73
ItemType specific C<delete> to clear relevant caches on delete.
74
75
=cut
76
77
sub delete {
78
    my $self = shift @_;
79
    $cache->clear_from_cache('itemtype:description:en');
80
    $self->SUPER::delete(@_);
81
}
82
70
=head3 image_location
83
=head3 image_location
71
84
72
=cut
85
=cut
(-)a/Koha/Library.pm (-1 / +14 lines)
Lines 29-34 use Koha::SMTP::Servers; Link Here
29
29
30
use base qw(Koha::Object);
30
use base qw(Koha::Object);
31
31
32
my $cache = Koha::Caches->get_instance();
33
32
=head1 NAME
34
=head1 NAME
33
35
34
Koha::Library - Koha Library Object class
36
Koha::Library - Koha Library Object class
Lines 59-71 sub store { Link Here
59
    $self = $self->SUPER::store;
61
    $self = $self->SUPER::store;
60
62
61
    if ($flush) {
63
    if ($flush) {
62
        my $cache = Koha::Caches->get_instance();
63
        $cache->clear_from_cache('libraries:name');
64
        $cache->clear_from_cache('libraries:name');
64
    }
65
    }
65
66
66
    return $self;
67
    return $self;
67
}
68
}
68
69
70
=head2 delete
71
72
Library specific C<delete> to clear relevant caches on delete.
73
74
=cut
75
76
sub delete {
77
    my $self = shift @_;
78
    $cache->clear_from_cache('libraries:name');
79
    $self->SUPER::delete(@_);
80
}
81
69
=head3 stockrotationstages
82
=head3 stockrotationstages
70
83
71
  my $stages = Koha::Library->stockrotationstages;
84
  my $stages = Koha::Library->stockrotationstages;
(-)a/Koha/Localization.pm (-2 / +17 lines)
Lines 20-25 use Modern::Perl; Link Here
20
use Koha::Database;
20
use Koha::Database;
21
21
22
use base qw(Koha::Object);
22
use base qw(Koha::Object);
23
        
24
my $cache = Koha::Caches->get_instance();
23
25
24
=head1 NAME
26
=head1 NAME
25
27
Lines 42-48 sub store { Link Here
42
    $self = $self->SUPER::store;
44
    $self = $self->SUPER::store;
43
45
44
    if ($self->entity eq 'itemtypes') {
46
    if ($self->entity eq 'itemtypes') {
45
        my $cache = Koha::Caches->get_instance();
46
        my $key = "itemtype:description:".$self->lang;
47
        my $key = "itemtype:description:".$self->lang;
47
        $cache->clear_from_cache($key);
48
        $cache->clear_from_cache($key);
48
    }
49
    }
Lines 50-55 sub store { Link Here
50
    return $self;
51
    return $self;
51
}
52
}
52
53
54
=head2 delete
55
56
Localization specific C<delete> to clear relevant caches on delete.
57
58
=cut
59
60
sub delete {
61
    my $self = shift @_;
62
    if ($self->entity eq 'itemtypes') {
63
        my $key = "itemtype:description:".$self->lang;
64
        $cache->clear_from_cache($key);
65
    }
66
    $self->SUPER::delete(@_);
67
}
68
53
sub _type {
69
sub _type {
54
    return 'Localization';
70
    return 'Localization';
55
}
71
}
56
- 

Return to bug 30920