PHP 클래스 Elcodi\Store\GeoBundle\Form\LocationSelectorBuilder

파일 보기 프로젝트 열기: elcodi/bamboo

보호된 프로퍼티들

프로퍼티 타입 설명
$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