@@ 17-40 (lines=24) @@ | ||
14 | use Jobs\Repository; |
|
15 | use Zend\ServiceManager\Factory\FactoryInterface; |
|
16 | ||
17 | class JobboardControllerFactory implements FactoryInterface |
|
18 | { |
|
19 | /** |
|
20 | * Name of the pagination service |
|
21 | * |
|
22 | * @var string $paginationService; |
|
23 | */ |
|
24 | protected $paginationService = 'Jobs/Board'; |
|
25 | ||
26 | public function __invoke(ContainerInterface $container, $requestedName, array $options = null) { |
|
27 | ||
28 | /* @var \Jobs\Options\JobboardSearchOptions $options */ |
|
29 | $options = $container->get( 'Jobs/JobboardSearchOptions' ); |
|
30 | ||
31 | /** |
|
32 | * @var $jobRepository Repository\Job |
|
33 | */ |
|
34 | $jobRepository = $container->get( 'repositories' )->get( 'Jobs/Job' ); |
|
35 | $defaultListener = $container->get( 'DefaultListeners' ); |
|
36 | $imageFileCacheManager = $container->get( 'Organizations\ImageFileCache\Manager' ); |
|
37 | ||
38 | return new JobboardController( $defaultListener, $jobRepository, $imageFileCacheManager, [ 'count' => $options->getPerPage() ] ); |
|
39 | } |
|
40 | } |
|
41 |
@@ 18-42 (lines=25) @@ | ||
15 | use Core\Repository\RepositoryService; |
|
16 | use Jobs\Controller\Plugin\InitializeJob; |
|
17 | ||
18 | class InitializeJobFactory implements FactoryInterface |
|
19 | { |
|
20 | ||
21 | /** |
|
22 | * Create an InitializeJob |
|
23 | * |
|
24 | * @param ContainerInterface $container |
|
25 | * @param string $requestedName |
|
26 | * @param null|array $options |
|
27 | * |
|
28 | * @return InitializeJob |
|
29 | */ |
|
30 | public function __invoke(ContainerInterface $container, $requestedName, array $options = null) |
|
31 | { |
|
32 | /* @var $repositories RepositoryService */ |
|
33 | $repositories = $container->get('repositories'); |
|
34 | /* @var \Auth\AuthenticationService */ |
|
35 | $auth = $container->get('AuthenticationService'); |
|
36 | /* @var \Acl\Controller\Plugin\Acl */ |
|
37 | $acl = $container->get('ControllerPluginManager')->get('acl'); |
|
38 | ||
39 | $plugin = new InitializeJob($repositories, $auth, $acl); |
|
40 | return $plugin; |
|
41 | } |
|
42 | } |
|
43 |
@@ 18-41 (lines=24) @@ | ||
15 | use Core\Repository\RepositoryService; |
|
16 | use Organizations\Controller\Plugin\GetOrganizationHandler; |
|
17 | ||
18 | class GetOrganizationHandlerFactory implements FactoryInterface { |
|
19 | ||
20 | /** |
|
21 | * Create a GetOrganizationHandler controller plugin |
|
22 | * |
|
23 | * @param ContainerInterface $container |
|
24 | * @param string $requestedName |
|
25 | * @param null|array $options |
|
26 | * |
|
27 | * @return GetOrganizationHandler |
|
28 | */ |
|
29 | public function __invoke(ContainerInterface $container, $requestedName, array $options = null) |
|
30 | { |
|
31 | /* @var $repositories RepositoryService */ |
|
32 | $repositories = $container->get('repositories'); |
|
33 | /* @var \Auth\AuthenticationService */ |
|
34 | $auth = $container->get('AuthenticationService'); |
|
35 | /* @var \Acl\Controller\Plugin\Acl */ |
|
36 | $acl = $container->get('ControllerPluginManager')->get('acl'); |
|
37 | ||
38 | $plugin = new GetOrganizationHandler($repositories, $auth, $acl); |
|
39 | return $plugin; |
|
40 | } |
|
41 | } |
|
42 |
@@ 23-37 (lines=15) @@ | ||
20 | * @package Organizations\Factory\Controller |
|
21 | * @since 0.30 |
|
22 | */ |
|
23 | class ProfileControllerFactory implements FactoryInterface |
|
24 | { |
|
25 | public function __invoke(ContainerInterface $container, $requestedName, array $options = null) |
|
26 | { |
|
27 | $repo = $container->get('repositories') |
|
28 | ->get('Organizations/Organization') |
|
29 | ; |
|
30 | $jobRepository = $container->get('repositories') |
|
31 | ->get('Jobs/Job') |
|
32 | ; |
|
33 | $translator = $container->get('translator'); |
|
34 | $imageFileCacheManager = $container->get('Organizations\ImageFileCache\Manager'); |
|
35 | return new ProfileController($repo,$jobRepository,$translator,$imageFileCacheManager); |
|
36 | } |
|
37 | } |
|
38 |