Elcodi\Store\GeoBundle\Form\LocationSelectorBuilder::getSelects PHP Method

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
    public function getSelects($locationId, $maxLocationType)
    {
        $this->selects = [];
        $this->maxLocationType = $maxLocationType;
        if ($locationId) {
            $hierarchy = $this->getHierarchy($locationId);
            $rootLocation = !empty($hierarchy) ? array_shift($hierarchy) : null;
            $this->buildRootSelector($rootLocation);
            if (!empty($rootLocation)) {
                $this->buildChildrenSelects($rootLocation, $hierarchy);
            }
        } else {
            $this->buildRootSelector();
        }
        return $this->selects;
    }