| Conditions | 2 |
| Paths | 2 |
| Total Lines | 23 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 28 | public function createService(ServiceLocatorInterface $serviceLocator) |
||
| 29 | { |
||
| 30 | /* @var $serviceLocator \Zend\ServiceManager\AbstractPluginManager |
||
| 31 | * @var $headscript \Zend\View\Helper\HeadScript |
||
| 32 | * @var $user \Auth\Entity\User |
||
| 33 | * @var $organization \Organizations\Entity\OrganizationInterface | \Organizations\Entity\OrganizationReferenceInterface |
||
| 34 | */ |
||
| 35 | $services = $serviceLocator->getServiceLocator(); |
||
| 36 | $user = $services->get('AuthenticationService')->getUser(); |
||
| 37 | $select = new HiringOrganizationSelect(); |
||
| 38 | $organization = $user->getOrganization(); |
||
| 39 | |||
| 40 | if ($organization->hasAssociation()) { |
||
| 41 | $organizations = $organization->getHiringOrganizations()->toArray(); |
||
| 42 | array_unshift($organizations, $organization->getOrganization()); |
||
| 43 | $select->setSelectableOrganizations($organizations, /* addEmptyOption */ |
||
| 44 | false |
||
| 45 | ); |
||
| 46 | |||
| 47 | } |
||
| 48 | |||
| 49 | return $select; |
||
| 50 | } |
||
| 51 | } |
||
| 52 |