src/Form/OrganizationSelect.php
public function setSelectableOrganizations($organizations, $addEmptyOption = true)
    {
        $options = $addEmptyOption ? ['0' => ''] : [];

        foreach ($organizations as $org) {
            /* @var $org \Organizations\Entity\Organization */

            $name     = $org->getOrganizationName()->getName();
            $contact  = $org->getContact();
            $image    = $org->getImage();
            $imageUrl = $image ? $image->getUri() : '';

            $options[$org->getId()] = $name . '|'
                                      . $contact->getCity() . '|'
                                      . $contact->getStreet() . '|'
                                      . $contact->getHouseNumber() . '|'
                                      . $imageUrl;
        }

        return $this->setValueOptions($options);
    }
public function setSelectableOrganizations($organizations, $addEmptyOption = true)
    {
        $options = $addEmptyOption ? ['0' => ''] : [];

        foreach ($organizations as $org) {
            /* @var $org \Organizations\Entity\Organization */

            $name     = $org->getOrganizationName()->getName();
            $contact  = $org->getContact();
            $image    = $org->getImage();
            $imageUrl = $image ? $image->getUri() : '';

            $options[$org->getId()] = $name . '|'
                                      . $contact->getCity() . '|'
                                      . $contact->getStreet() . '|'
                                      . $contact->getHouseNumber() . '|'
                                      . $imageUrl;
        }

        return $this->setValueOptions($options);
    }
public function setSelectableOrganizations ( $ organizations , $ addEmptyOption = true ) { $ options = $ addEmptyOption ? [ '0' => '' ] : [ ] ; foreach ( $ organizations as $ org ) { /* @var $org \Organizations\Entity\Organization */ $ name = $ org -> getOrganizationName ( ) -> getName ( ) ; $ contact = $ org -> getContact ( ) ; $ image = $ org -> getImage ( ) ; $ imageUrl = $ image ? $ image -> getUri ( ) : '' ; $ options [ $ org -> getId ( ) ] = $ name . '|' . $ contact -> getCity ( ) . '|' . $ contact -> getStreet ( ) . '|' . $ contact -> getHouseNumber ( ) . '|' . $ imageUrl ; } return $ this -> setValueOptions ( $ options ) ; }
Sets the selectable organizations.

@param Cursor|array $organizations
@param bool         $addEmptyOption If true, an empty option is created as the first value option.

@return self
Sets the selectable organizations .