PHP Class Elcodi\Admin\GeoBundle\Form\LocationSelectorBuilder

Show file Open project: elcodi/bamboo

Public Methods

Method Description
__construct ( Elcodi\Component\Geo\Adapter\LocationProvider\Interfaces\LocationProviderAdapterInterface $locationProvider ) Builds a new class
getSelects ( string $locationId, string $maxLocationType ) : array Builds the selects structure

Private Methods

Method Description
buildChildrenSelects ( Elcodi\Component\Geo\ValueObject\LocationData $selectedRootLocation, array $hierarchy ) Builds the children (Not root) selectors given a hierarchy, we also use the root location to know which one is selected.
buildRootSelector ( null | Elcodi\Component\Geo\ValueObject\LocationData $selectedLocation = null ) Builds the root selector with all the first level options
formatSelector ( string $type, array $options, string | null $selected = null ) : array Returns a well formatted selector
generateOptions ( array $rawOptions ) : array Generates all the options for a select given the raw options from the areas info from the API.
getHierarchy ( string $locationId ) : Elcodi\Component\Geo\ValueObject\LocationData[] Gets the location hierarchy.

Method Details

__construct() public method

Builds a new class
public __construct ( Elcodi\Component\Geo\Adapter\LocationProvider\Interfaces\LocationProviderAdapterInterface $locationProvider )
$locationProvider Elcodi\Component\Geo\Adapter\LocationProvider\Interfaces\LocationProviderAdapterInterface Location provider adapter

getSelects() public method

Builds the selects structure
public getSelects ( string $locationId, string $maxLocationType ) : array
$locationId string The location id selected
$maxLocationType string The max type that we want to show.
return array