-
Notifications
You must be signed in to change notification settings - Fork 17
/
collection.php
56 lines (41 loc) · 1.13 KB
/
collection.php
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
require_once("utils.php");
class Collection {
// The title of the collection
public $sac_colltitle;
// The URL of the collection (where you can deposit to)
public $sac_href;
// The types of content accepted
public $sac_accept;
// The alternative types of content accepted
public $sac_acceptalternative;
// The accepted packaging formats
public $sac_acceptpackaging;
// The collection policy
public $sac_collpolicy;
// The colelction abstract (dcterms)
public $sac_abstract;
// Whether mediation is allowed or not
public $sac_mediation;
// A nested service document
public $sac_service;
// Construct a new collection by passing in a title
function __construct($sac_newcolltitle) {
// Store the title
$this->sac_colltitle = sac_clean($sac_newcolltitle);
// Create the accepts arrays
$sac_accept = array();
$sac_acceptalternative = array();
$sac_acceptpackaging = array();
}
// Add a new supported packaging type
function addAcceptPackaging($ap) {
$format = (string)$ap[0];
$q = (string)$ap[0]['q'];
if (empty($q)) {
$q = "1.0";
}
$this->sac_acceptpackaging[$format] = $q;
}
}
?>