|
Lines 34-40
sub new {
Link Here
|
| 34 |
adminEmail => C4::Context->preference("KohaAdminEmailAddress"), |
34 |
adminEmail => C4::Context->preference("KohaAdminEmailAddress"), |
| 35 |
MaxCount => C4::Context->preference("OAI-PMH:MaxCount"), |
35 |
MaxCount => C4::Context->preference("OAI-PMH:MaxCount"), |
| 36 |
granularity => 'YYYY-MM-DD', |
36 |
granularity => 'YYYY-MM-DD', |
| 37 |
earliestDatestamp => '0001-01-01', |
37 |
earliestDatestamp => _get_earliest_datestamp() || '0001-01-01', |
| 38 |
deletedRecord => C4::Context->preference("OAI-PMH:DeletedRecord") || 'no', |
38 |
deletedRecord => C4::Context->preference("OAI-PMH:DeletedRecord") || 'no', |
| 39 |
); |
39 |
); |
| 40 |
|
40 |
|
|
Lines 49-52
sub new {
Link Here
|
| 49 |
return $self; |
49 |
return $self; |
| 50 |
} |
50 |
} |
| 51 |
|
51 |
|
|
|
52 |
# Find the earliest timestamp in the biblio table. If this table is empty, undef |
| 53 |
# will be returned and we will report the fallback 0001-01-01. |
| 54 |
sub _get_earliest_datestamp { |
| 55 |
|
| 56 |
my $dbh = C4::Context->dbh; |
| 57 |
|
| 58 |
my $order_sth = $dbh->prepare( "SELECT DATE(MIN(timestamp)) AS earliest FROM biblio" ); |
| 59 |
$order_sth->execute(); |
| 60 |
my $res = $order_sth->fetchrow_hashref(); |
| 61 |
|
| 62 |
return $res->{'earliest'}; |
| 63 |
|
| 64 |
} |
| 65 |
|
| 52 |
1; |
66 |
1; |
| 53 |
- |
|
|