@@ 21-55 (lines=35) @@ | ||
18 | * |
|
19 | * @author Ivannis Suárez Jerez <[email protected]> |
|
20 | */ |
|
21 | class DocumentQueryRepositoryFactory implements DocumentQueryRepositoryFactoryInterface |
|
22 | { |
|
23 | /** |
|
24 | * @var DocumentManager |
|
25 | */ |
|
26 | protected $documentManager; |
|
27 | ||
28 | /** |
|
29 | * @var DocumentDataSourceFactory |
|
30 | */ |
|
31 | protected $documentDatasourceFactory; |
|
32 | ||
33 | /** |
|
34 | * DocumentQueryRepositoryFactory constructor. |
|
35 | * |
|
36 | * @param DocumentManager $documentManager |
|
37 | * @param DocumentDataSourceFactory $documentDatasourceFactory |
|
38 | */ |
|
39 | public function __construct(DocumentManager $documentManager, DocumentDataSourceFactory $documentDatasourceFactory) |
|
40 | { |
|
41 | $this->documentManager = $documentManager; |
|
42 | $this->documentDatasourceFactory = $documentDatasourceFactory; |
|
43 | } |
|
44 | ||
45 | /** |
|
46 | * {@inheritdoc} |
|
47 | */ |
|
48 | public function create($documentName) |
|
49 | { |
|
50 | return new DocumentQueryRepository( |
|
51 | $this->documentManager->getRepository($documentName), |
|
52 | $this->documentDatasourceFactory |
|
53 | ); |
|
54 | } |
|
55 | } |
|
56 |
@@ 21-55 (lines=35) @@ | ||
18 | * |
|
19 | * @author Ivannis Suárez Jerez <[email protected]> |
|
20 | */ |
|
21 | class DocumentRepositoryFactory implements DocumentRepositoryFactoryInterface |
|
22 | { |
|
23 | /** |
|
24 | * @var DocumentManager |
|
25 | */ |
|
26 | protected $documentManager; |
|
27 | ||
28 | /** |
|
29 | * @var DocumentDataSourceFactory |
|
30 | */ |
|
31 | protected $documentDatasourceFactory; |
|
32 | ||
33 | /** |
|
34 | * DocumentRepositoryFactory constructor. |
|
35 | * |
|
36 | * @param DocumentManager $documentManager |
|
37 | * @param DocumentDataSourceFactory $documentDatasourceFactory |
|
38 | */ |
|
39 | public function __construct(DocumentManager $documentManager, DocumentDataSourceFactory $documentDatasourceFactory) |
|
40 | { |
|
41 | $this->documentManager = $documentManager; |
|
42 | $this->documentDatasourceFactory = $documentDatasourceFactory; |
|
43 | } |
|
44 | ||
45 | /** |
|
46 | * {@inheritdoc} |
|
47 | */ |
|
48 | public function create($documentName) |
|
49 | { |
|
50 | return new DocumentRepository( |
|
51 | $this->documentManager->getRepository($documentName), |
|
52 | $this->documentDatasourceFactory |
|
53 | ); |
|
54 | } |
|
55 | } |
|
56 |