PHP Класс Elcodi\Store\GeoBundle\Form\LocationSelectorBuilder

Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$maxLocationType string The max location type that we want to show.
$selects array The selects structure

Открытые методы

Метод Описание
__construct ( Elcodi\Component\Geo\Adapter\LocationProvider\Interfaces\LocationProviderAdapterInterface $locationProvider ) Builds a new class
getSelects ( string $locationId, string $maxLocationType ) : array Builds the selects structure

Защищенные методы

Метод Описание
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.

Описание методов

__construct() публичный Метод

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

buildChildrenSelects() защищенный Метод

Builds the children (Not root) selectors given a hierarchy, we also use the root location to know which one is selected.
protected buildChildrenSelects ( Elcodi\Component\Geo\ValueObject\LocationData $selectedRootLocation, array $hierarchy )
$selectedRootLocation Elcodi\Component\Geo\ValueObject\LocationData
$hierarchy array

buildRootSelector() защищенный Метод

Builds the root selector with all the first level options
protected buildRootSelector ( null | Elcodi\Component\Geo\ValueObject\LocationData $selectedLocation = null )
$selectedLocation null | Elcodi\Component\Geo\ValueObject\LocationData The selected option

formatSelector() защищенный Метод

Returns a well formatted selector
protected formatSelector ( string $type, array $options, string | null $selected = null ) : array
$type string The selector type
$options array The selector options
$selected string | null The selected option
Результат array

generateOptions() защищенный Метод

Generates all the options for a select given the raw options from the areas info from the API.
protected generateOptions ( array $rawOptions ) : array
$rawOptions array The raw options
Результат array

getHierarchy() защищенный Метод

Gets the location hierarchy.
protected getHierarchy ( string $locationId ) : Elcodi\Component\Geo\ValueObject\LocationData[]
$locationId string The location identifier
Результат Elcodi\Component\Geo\ValueObject\LocationData[]

getSelects() публичный Метод

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.
Результат array

Описание свойств

$maxLocationType защищенное свойство

The max location type that we want to show.
protected string $maxLocationType
Результат string

$selects защищенное свойство

The selects structure
protected array $selects
Результат array