@@ -37,7 +37,7 @@ |
||
37 | 37 | /* @TODO: $jobRepository should be removed when using aggregation query in filtering profile */ |
38 | 38 | $authService = $container->get('AuthenticationService'); |
39 | 39 | $jobRepository = $container->get('Core/RepositoryService')->get('Jobs/Job'); |
40 | - $filter = new PaginationQuery($jobRepository,$authService); |
|
40 | + $filter = new PaginationQuery($jobRepository, $authService); |
|
41 | 41 | return $filter; |
42 | 42 | } |
43 | 43 | } |
@@ -33,6 +33,6 @@ |
||
33 | 33 | $translator = $container->get('translator'); |
34 | 34 | $imageFileCacheManager = $container->get('Organizations\ImageFileCache\Manager'); |
35 | 35 | $options = $container->get('Jobs/JobboardSearchOptions'); |
36 | - return new ProfileController($repo,$jobRepository,$translator,$imageFileCacheManager,['count' => $options->getPerPage()]); |
|
36 | + return new ProfileController($repo, $jobRepository, $translator, $imageFileCacheManager, ['count' => $options->getPerPage()]); |
|
37 | 37 | } |
38 | 38 | } |
@@ -28,27 +28,27 @@ |
||
28 | 28 | */ |
29 | 29 | class FileController extends AbstractActionController |
30 | 30 | { |
31 | - /** |
|
32 | - * @var RepositoryService |
|
33 | - */ |
|
34 | - private $repositories; |
|
31 | + /** |
|
32 | + * @var RepositoryService |
|
33 | + */ |
|
34 | + private $repositories; |
|
35 | 35 | |
36 | - /** |
|
37 | - * @var EventManager |
|
38 | - */ |
|
39 | - private $coreFileEvents; |
|
36 | + /** |
|
37 | + * @var EventManager |
|
38 | + */ |
|
39 | + private $coreFileEvents; |
|
40 | 40 | |
41 | - public function __construct( |
|
42 | - RepositoryService $repositories, |
|
43 | - EventManager $eventManager |
|
44 | - ) |
|
45 | - { |
|
46 | - $this->repositories = $repositories; |
|
47 | - $this->coreFileEvents = $eventManager; |
|
48 | - } |
|
41 | + public function __construct( |
|
42 | + RepositoryService $repositories, |
|
43 | + EventManager $eventManager |
|
44 | + ) |
|
45 | + { |
|
46 | + $this->repositories = $repositories; |
|
47 | + $this->coreFileEvents = $eventManager; |
|
48 | + } |
|
49 | 49 | |
50 | 50 | |
51 | - protected function attachDefaultListeners() |
|
51 | + protected function attachDefaultListeners() |
|
52 | 52 | { |
53 | 53 | parent::attachDefaultListeners(); |
54 | 54 | $events = $this->getEventManager(); |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | $response = $this->getResponse(); |
74 | 74 | |
75 | 75 | try { |
76 | - $repository = $this->repositories->get($module . '/' . $entityName); |
|
76 | + $repository = $this->repositories->get($module.'/'.$entityName); |
|
77 | 77 | } catch (\Exception $e) { |
78 | 78 | $response->setStatusCode(404); |
79 | 79 | $this->getEvent()->setParam('exception', $e); |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | |
108 | 108 | $this->acl($file); |
109 | 109 | |
110 | - $headers=$response->getHeaders(); |
|
110 | + $headers = $response->getHeaders(); |
|
111 | 111 | |
112 | 112 | $headers->addHeaderline('Content-Type', $file->getType()) |
113 | 113 | ->addHeaderline('Content-Length', $file->getLength()); |
@@ -26,6 +26,6 @@ |
||
26 | 26 | $repositories = $container->get('repositories'); |
27 | 27 | $coreFileEvents = $container->get('Core/File/Events'); |
28 | 28 | |
29 | - return new FileController($repositories,$coreFileEvents); |
|
29 | + return new FileController($repositories, $coreFileEvents); |
|
30 | 30 | } |
31 | 31 | } |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | { |
83 | 83 | |
84 | 84 | $result = $this->pagination([ |
85 | - 'params' => ['Organizations_Profile',[ |
|
85 | + 'params' => ['Organizations_Profile', [ |
|
86 | 86 | 'q', |
87 | 87 | 'count' => $this->options['count'], |
88 | 88 | 'page' => 1, |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | $repo = $this->repo; |
117 | 117 | $id = $this->params('id'); |
118 | 118 | |
119 | - if(is_null($id)){ |
|
119 | + if (is_null($id)) { |
|
120 | 120 | $this->getResponse()->setStatusCode(Response::STATUS_CODE_404); |
121 | 121 | return [ |
122 | 122 | 'message' => $translator->translate('Can not access profile page without id'), |
@@ -125,20 +125,20 @@ discard block |
||
125 | 125 | } |
126 | 126 | |
127 | 127 | $organization = $repo->find($id); |
128 | - if(!$organization instanceof Organization){ |
|
128 | + if (!$organization instanceof Organization) { |
|
129 | 129 | throw new NotFoundException($id); |
130 | 130 | } |
131 | 131 | |
132 | - if( |
|
132 | + if ( |
|
133 | 133 | Organization::PROFILE_DISABLED == $organization->getProfileSetting() |
134 | 134 | || is_null($organization->getProfileSetting()) |
135 | - ){ |
|
135 | + ) { |
|
136 | 136 | throw new UnauthorizedAccessException(/*@translate*/ 'This Organization Profile is disabled'); |
137 | 137 | } |
138 | 138 | |
139 | 139 | $result = $this->pagination([ |
140 | 140 | 'params' => [ |
141 | - 'Organization_Jobs',[ |
|
141 | + 'Organization_Jobs', [ |
|
142 | 142 | 'q', |
143 | 143 | 'organization_id' => $id, |
144 | 144 | 'count' => $this->options['count'], |
@@ -151,13 +151,13 @@ discard block |
||
151 | 151 | ], |
152 | 152 | ]); |
153 | 153 | |
154 | - if( |
|
154 | + if ( |
|
155 | 155 | Organization::PROFILE_ACTIVE_JOBS == $organization->getProfileSetting() |
156 | - ){ |
|
156 | + ) { |
|
157 | 157 | /* @var \Zend\Paginator\Paginator $paginator */ |
158 | 158 | $paginator = $result['jobs']; |
159 | 159 | $count = $paginator->getTotalItemCount(); |
160 | - if(0===$count){ |
|
160 | + if (0 === $count) { |
|
161 | 161 | throw new UnauthorizedAccessException($this->translator->translate('This Organization Profile is disabled')); |
162 | 162 | } |
163 | 163 | } |