| Conditions | 3 |
| Paths | 3 |
| Total Lines | 25 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 1 | Features | 0 |
| 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 | $organizationReference = $user->getOrganization(); |
||
| 39 | |||
| 40 | if ($organizationReference->hasAssociation()) { |
||
| 41 | $organizations = $organizationReference->getHiringOrganizations()->toArray(); |
||
| 42 | $organization = $organizationReference->getOrganization(); |
||
| 43 | if (!$organization->isDraft()) { |
||
| 44 | array_unshift($organizations, $organization); |
||
| 45 | } |
||
| 46 | $select->setSelectableOrganizations($organizations, /* addEmptyOption */ |
||
| 47 | false |
||
| 48 | ); |
||
| 49 | } |
||
| 50 | |||
| 51 | return $select; |
||
| 52 | } |
||
| 53 | } |
||
| 54 |