1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Alchemy\Phraseanet\Helper; |
4
|
|
|
|
5
|
|
|
use Alchemy\Phraseanet\ChainedTokenProvider; |
6
|
|
|
use Alchemy\Phraseanet\Mapping\DefinitionMap; |
7
|
|
|
use Alchemy\Phraseanet\TokenProvider; |
8
|
|
|
|
9
|
|
|
/** |
10
|
|
|
* Class InstanceHelper acts as a helper registry for a given instance. |
11
|
|
|
* @package Alchemy\Phraseanet\Helper |
12
|
|
|
*/ |
13
|
|
|
class InstanceHelper |
14
|
|
|
{ |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* @var DefinitionMap |
18
|
|
|
*/ |
19
|
|
|
private $definitionMap; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* @var FeedHelper |
23
|
|
|
*/ |
24
|
|
|
private $feedHelper; |
25
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* @var MetadataHelper |
28
|
|
|
*/ |
29
|
|
|
private $metadataHelper; |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* @var ThumbHelper |
33
|
|
|
*/ |
34
|
|
|
private $thumbHelper; |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* @var TokenProvider |
38
|
|
|
*/ |
39
|
|
|
private $tokenProvider; |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* @param DefinitionMap $definitionMap |
43
|
|
|
* @param FeedHelper $feedHelper |
44
|
|
|
* @param MetadataHelper $metadataHelper |
45
|
|
|
* @param ThumbHelper $thumbHelper |
46
|
|
|
*/ |
47
|
1 |
|
public function __construct( |
48
|
|
|
DefinitionMap $definitionMap, |
49
|
|
|
FeedHelper $feedHelper, |
50
|
|
|
MetadataHelper $metadataHelper, |
51
|
|
|
ThumbHelper $thumbHelper |
52
|
|
|
) { |
53
|
1 |
|
$this->definitionMap = $definitionMap; |
54
|
1 |
|
$this->feedHelper = $feedHelper; |
55
|
1 |
|
$this->metadataHelper = $metadataHelper; |
56
|
1 |
|
$this->thumbHelper = $thumbHelper; |
57
|
|
|
|
58
|
1 |
|
$this->tokenProvider = new ChainedTokenProvider(); |
59
|
1 |
|
} |
60
|
|
|
|
61
|
|
|
public function setTokenProvider(TokenProvider $tokenProvider) |
62
|
|
|
{ |
63
|
|
|
$this->tokenProvider = $tokenProvider; |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
public function getTokenProvider() |
67
|
|
|
{ |
68
|
|
|
return $this->tokenProvider; |
69
|
|
|
} |
70
|
|
|
|
71
|
1 |
|
public function getDefinitionMap() |
72
|
|
|
{ |
73
|
1 |
|
return $this->definitionMap; |
74
|
|
|
} |
75
|
|
|
|
76
|
1 |
|
public function getFeedHelper() |
77
|
|
|
{ |
78
|
1 |
|
return $this->feedHelper; |
79
|
|
|
} |
80
|
|
|
|
81
|
1 |
|
public function getMetadataHelper() |
82
|
|
|
{ |
83
|
1 |
|
return $this->metadataHelper; |
84
|
|
|
} |
85
|
|
|
|
86
|
1 |
|
public function getThumbHelper() |
87
|
|
|
{ |
88
|
1 |
|
return $this->thumbHelper; |
89
|
|
|
} |
90
|
|
|
} |
91
|
|
|
|