PHP Class ShopTools, silvershop-core

Afficher le fichier Open project: burnbright/silverstripe-shop Class Usage Examples

Méthodes publiques

Méthode Description
DBConn ( string $name = 'default' ) : SS_Database Get the DB connection in a SS 3.1 and 3.2+ compatible way
get_current_locale ( ) : string Get the current locale.
install_locale ( string $locale ) Set/Install the given locale.
price_for_display ( mixed $price ) : Money Convert a numeric price to the shop currency

Method Details

DBConn() public static méthode

Get the DB connection in a SS 3.1 and 3.2+ compatible way
public static DBConn ( string $name = 'default' ) : SS_Database
$name string
Résultat SS_Database

get_current_locale() public static méthode

Tries to get the locale from Translatable, Fluent or the default i18n (depending on what is installed)
public static get_current_locale ( ) : string
Résultat string the locale in use

install_locale() public static méthode

This does set the i18n locale as well as the Translatable or Fluent locale (if any of these modules is installed)
public static install_locale ( string $locale )
$locale string the locale to install

price_for_display() public static méthode

Convert a numeric price to the shop currency
public static price_for_display ( mixed $price ) : Money
$price mixed the price to convert
Résultat Money the price wrapped in a Money DBField to be used for templates or similar