PHP Class MenaraSolutions\Geographer\Services\Poliglottas\Base

Inheritance: implements MenaraSolutions\Geographer\Contracts\PoliglottaInterface
Show file Open project: menarasolutions/geographer

Protected Properties

Property Type Description
$agency MenaraSolutions\Geographer\Contracts\TranslationAgencyInterface
$cache array
$code string
$defaultPrepositions array

Public Methods

Method Description
__construct ( MenaraSolutions\Geographer\Contracts\TranslationAgencyInterface $agency ) Base constructor.
translate ( MenaraSolutions\Geographer\Contracts\IdentifiableInterface $subject, string $form = 'default', boolean $preposition = true ) : string

Protected Methods

Method Description
extract ( array $meta, boolean $long, $form, boolean $fallback = false ) : mixed
fromDictionary ( MenaraSolutions\Geographer\Contracts\IdentifiableInterface $subject ) : array
getPreposition ( $form, string $result = null ) : string
inflictDefault ( array $meta, $long ) : string
inflictFrom ( string $template ) : string
inflictIn ( string $template ) : string

Method Details

__construct() public method

Base constructor.
public __construct ( MenaraSolutions\Geographer\Contracts\TranslationAgencyInterface $agency )
$agency MenaraSolutions\Geographer\Contracts\TranslationAgencyInterface

extract() protected method

protected extract ( array $meta, boolean $long, $form, boolean $fallback = false ) : mixed
$meta array
$long boolean
$form
$fallback boolean
return mixed

fromDictionary() protected method

protected fromDictionary ( MenaraSolutions\Geographer\Contracts\IdentifiableInterface $subject ) : array
$subject MenaraSolutions\Geographer\Contracts\IdentifiableInterface
return array

getPreposition() protected method

protected getPreposition ( $form, string $result = null ) : string
$form
$result string
return string

inflictDefault() protected method

protected inflictDefault ( array $meta, $long ) : string
$meta array
$long
return string

inflictFrom() protected method

protected inflictFrom ( string $template ) : string
$template string
return string

inflictIn() protected method

protected inflictIn ( string $template ) : string
$template string
return string

translate() public method

public translate ( MenaraSolutions\Geographer\Contracts\IdentifiableInterface $subject, string $form = 'default', boolean $preposition = true ) : string
$subject MenaraSolutions\Geographer\Contracts\IdentifiableInterface
$form string
$preposition boolean
return string

Property Details

$agency protected property

protected TranslationAgencyInterface,MenaraSolutions\Geographer\Contracts $agency
return MenaraSolutions\Geographer\Contracts\TranslationAgencyInterface

$cache protected property

protected array $cache
return array

$code protected property

protected string $code
return string

$defaultPrepositions protected property

protected array $defaultPrepositions
return array