|
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 |
- |
|
|