PHP Class RegionRestriction, silvershop-core

Inheritance: extends DataObject
Show file Open project: burnbright/silverstripe-shop Class Usage Examples

Public Methods

Method Description
address_filter ( Address $address ) Produce a SQL filter to get matching RegionRestrictions to a given address
get_table_field_types ( )
onBeforeWrite ( )
parse_uk_postcode ( str $postcode ) : array Parses a UK postcode to give you the different sections
wildcard_sort ( $field, $direction = "ASC" ) Produces a sort check to make wildcards come last.

Method Details

address_filter() public static method

Produce a SQL filter to get matching RegionRestrictions to a given address
public static address_filter ( Address $address )
$address Address

get_table_field_types() public static method

public static get_table_field_types ( )

onBeforeWrite() public method

public onBeforeWrite ( )

parse_uk_postcode() public static method

Parses a UK postcode to give you the different sections
public static parse_uk_postcode ( str $postcode ) : array
$postcode str
return array

wildcard_sort() public static method

Useful because we are only interested in the wildcard, and not sorting of other values.
public static wildcard_sort ( $field, $direction = "ASC" )