1
|
|
|
<?php |
2
|
|
|
namespace Dkd\PhpCmis; |
3
|
|
|
|
4
|
|
|
/* |
5
|
|
|
* This file is part of php-cmis-client. |
6
|
|
|
* |
7
|
|
|
* (c) Sascha Egerer <[email protected]> |
8
|
|
|
* |
9
|
|
|
* For the full copyright and license information, please view the LICENSE |
10
|
|
|
* file that was distributed with this source code. |
11
|
|
|
*/ |
12
|
|
|
|
13
|
|
|
use Dkd\PhpCmis\Bindings\CmisBindingsHelper; |
14
|
|
|
use Doctrine\Common\Cache\Cache; |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* Class SessionFactory |
18
|
|
|
*/ |
19
|
|
|
class SessionFactory implements SessionFactoryInterface |
20
|
|
|
{ |
21
|
|
|
/** |
22
|
|
|
* @param array $parameters |
23
|
|
|
* @param ObjectFactoryInterface|null $objectFactory |
24
|
|
|
* @param Cache|null $cache |
25
|
|
|
* @param Cache|null $typeDefinitionCache |
26
|
|
|
* @return Session |
27
|
|
|
*/ |
28
|
|
|
public function createSession( |
29
|
|
|
array $parameters, |
30
|
|
|
ObjectFactoryInterface $objectFactory = null, |
31
|
|
|
Cache $cache = null, |
32
|
|
|
Cache $typeDefinitionCache = null |
33
|
|
|
) { |
34
|
|
|
$session = new Session($parameters, $objectFactory, $cache, $typeDefinitionCache); |
35
|
|
|
return $session; |
36
|
|
|
} |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @param array $parameters |
40
|
|
|
* @param ObjectFactoryInterface|null $objectFactory |
41
|
|
|
* @param Cache|null $cache |
42
|
|
|
* @param Cache|null $typeDefinitionCache |
43
|
|
|
* @return Data\RepositoryInfoInterface[] |
44
|
|
|
*/ |
45
|
|
|
public function getRepositories( |
46
|
|
|
array $parameters, |
47
|
|
|
ObjectFactoryInterface $objectFactory = null, |
48
|
|
|
Cache $cache = null, |
49
|
|
|
Cache $typeDefinitionCache = null |
50
|
|
|
) { |
51
|
|
|
$cmisBindingsHelper = new CmisBindingsHelper(); |
52
|
|
|
$binding = $cmisBindingsHelper->createBinding( |
53
|
|
|
$parameters, |
54
|
|
|
$typeDefinitionCache |
55
|
|
|
); |
56
|
|
|
|
57
|
|
|
return $binding->getRepositoryService()->getRepositoryInfos(); |
58
|
|
|
} |
59
|
|
|
} |
60
|
|
|
|