PHP 클래스 ShopTools, silvershop-core

파일 보기 프로젝트 열기: burnbright/silverstripe-shop 1 사용 예제들

공개 메소드들

메소드 설명
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

메소드 상세

DBConn() 공개 정적인 메소드

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

get_current_locale() 공개 정적인 메소드

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

install_locale() 공개 정적인 메소드

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() 공개 정적인 메소드

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