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

(-)a/Koha/ClassSource.pm (-1 / +34 lines)
Lines 17-23 package Koha::ClassSource; Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
20
use Koha::BiblioFrameworks;
21
use Koha::Caches;
21
use Koha::Database;
22
use Koha::Database;
22
23
23
use base qw(Koha::Object);
24
use base qw(Koha::Object);
Lines 30-37 Koha::ClassSource - Koha Classfication Source Object class Link Here
30
31
31
=head2 Class Methods
32
=head2 Class Methods
32
33
34
=head3 store
35
36
ClassSource specific store to ensure relevant caches are flushed on change
37
33
=cut
38
=cut
34
39
40
sub store {
41
    my ($self) = @_;
42
43
    my $flush = 0;
44
45
    if ( !$self->in_storage ) {
46
        $flush = 1;
47
    }
48
    else {
49
        my $self_from_storage = $self->get_from_storage;
50
        $flush = 1 if ( $self_from_storage->description ne $self->description );
51
    }
52
53
    $self = $self->SUPER::store;
54
55
    if ($flush) {
56
        my $cache = Koha::Caches->get_instance();
57
        my @frameworks =
58
          Koha::BiblioFrameworks->search()->get_column('frameworkcode');
59
        for my $frameworkcode (@frameworks) {
60
            my $key = "MarcAVStructure-$frameworkcode";
61
            $cache->clear_from_cache($key);
62
        }
63
    }
64
65
    return $self;
66
}
67
35
=head3 _type
68
=head3 _type
36
69
37
Returns name of corresponding DBIC resultset
70
Returns name of corresponding DBIC resultset
(-)a/Koha/ItemType.pm (+36 lines)
Lines 20-25 use Modern::Perl; Link Here
20
20
21
use C4::Koha qw( getitemtypeimagelocation );
21
use C4::Koha qw( getitemtypeimagelocation );
22
use C4::Languages;
22
use C4::Languages;
23
use Koha::BiblioFrameworks;
24
use Koha::Caches;
23
use Koha::Database;
25
use Koha::Database;
24
use Koha::CirculationRules;
26
use Koha::CirculationRules;
25
use Koha::Localizations;
27
use Koha::Localizations;
Lines 36-41 Koha::ItemType - Koha Item type Object class Link Here
36
38
37
=cut
39
=cut
38
40
41
=head3 store
42
43
ItemType specific store to ensure relevant caches are flushed on change
44
45
=cut
46
47
sub store {
48
    my ($self) = @_;
49
50
    my $flush = 0;
51
52
    if ( !$self->in_storage ) {
53
        $flush = 1;
54
    }
55
    else {
56
        my $self_from_storage = $self->get_from_storage;
57
        $flush = 1 if ( $self_from_storage->description ne $self->description );
58
    }
59
60
    $self = $self->SUPER::store;
61
62
    if ($flush) {
63
        my $cache = Koha::Caches->get_instance();
64
        my @frameworks =
65
          Koha::BiblioFrameworks->search()->get_column('frameworkcode');
66
        for my $frameworkcode (@frameworks) {
67
            my $key = "MarcAVStructure-$frameworkcode";
68
            $cache->clear_from_cache($key);
69
        }
70
    }
71
72
    return $self;
73
}
74
39
=head3 image_location
75
=head3 image_location
40
76
41
=cut
77
=cut
(-)a/Koha/Library.pm (-1 / +36 lines)
Lines 22-27 use Modern::Perl; Link Here
22
22
23
use C4::Context;
23
use C4::Context;
24
24
25
use Koha::BiblioFrameworks;
26
use Koha::Caches;
25
use Koha::Database;
27
use Koha::Database;
26
use Koha::StockRotationStages;
28
use Koha::StockRotationStages;
27
use Koha::SMTP::Servers;
29
use Koha::SMTP::Servers;
Lines 36-41 Koha::Library - Koha Library Object class Link Here
36
38
37
=head2 Class methods
39
=head2 Class methods
38
40
41
=head3 store
42
43
Library specific store to ensure relevant caches are flushed on change
44
45
=cut
46
47
sub store {
48
    my ($self) = @_;
49
50
    my $flush = 0;
51
52
    if ( !$self->in_storage ) {
53
        $flush = 1;
54
    }
55
    else {
56
        my $self_from_storage = $self->get_from_storage;
57
        $flush = 1 if ( $self_from_storage->branchname ne $self->branchname );
58
    }
59
60
    $self = $self->SUPER::store;
61
62
    if ($flush) {
63
        my $cache = Koha::Caches->get_instance();
64
        my @frameworks =
65
          Koha::BiblioFrameworks->search()->get_column('frameworkcode');
66
        for my $frameworkcode (@frameworks) {
67
            my $key = "MarcAVStructure-$frameworkcode";
68
            $cache->clear_from_cache($key);
69
        }
70
    }
71
72
    return $self;
73
}
74
39
=head3 stockrotationstages
75
=head3 stockrotationstages
40
76
41
  my $stages = Koha::Library->stockrotationstages;
77
  my $stages = Koha::Library->stockrotationstages;
42
- 

Return to bug 30848