PHP Class MenaraSolutions\Geographer\Repositories\File

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

Protected Properties

Property Type Description
$cache array
$indexes array
$paths array
$prefix string Path to resource files
$translationsPrefix string Path to translation files

Public Methods

Method Description
__construct ( string $prefix = null, string $translationsPrefix = null ) File constructor.
getData ( $class, array $params ) : array
getPath ( string $class, string $prefix, array $params ) : string
getTranslations ( MenaraSolutions\Geographer\Contracts\IdentifiableInterface $subject, $language ) : array
getTranslationsPath ( MenaraSolutions\Geographer\Contracts\IdentifiableInterface $subject, $language ) : string
getTranslationsPrefix ( ) : string
guessTranslationsPrefix ( ) : string
indexSearch ( integer $id, string $class ) : array
loadJson ( string $path ) : array
setPrefix ( string $prefix )
setTranslationsPrefix ( string $prefix )

Protected Methods

Method Description
getCodeFromIndex ( $path, $id ) : mixed
loadTranslations ( string $path )

Private Methods

Method Description
getDefaultPath ( ) : string

Method Details

__construct() public method

File constructor.
public __construct ( string $prefix = null, string $translationsPrefix = null )
$prefix string
$translationsPrefix string

getCodeFromIndex() protected method

protected getCodeFromIndex ( $path, $id ) : mixed
$path
$id
return mixed

getData() public method

public getData ( $class, array $params ) : array
$class
$params array
return array

getPath() public method

public getPath ( string $class, string $prefix, array $params ) : string
$class string
$prefix string
$params array
return string

getTranslations() public method

public getTranslations ( MenaraSolutions\Geographer\Contracts\IdentifiableInterface $subject, $language ) : array
$subject MenaraSolutions\Geographer\Contracts\IdentifiableInterface
$language
return array

getTranslationsPath() public method

public getTranslationsPath ( MenaraSolutions\Geographer\Contracts\IdentifiableInterface $subject, $language ) : string
$subject MenaraSolutions\Geographer\Contracts\IdentifiableInterface
$language
return string

getTranslationsPrefix() public method

public getTranslationsPrefix ( ) : string
return string

guessTranslationsPrefix() public method

public guessTranslationsPrefix ( ) : string
return string

indexSearch() public method

public indexSearch ( integer $id, string $class ) : array
$id integer
$class string
return array

loadJson() public method

public loadJson ( string $path ) : array
$path string
return array

loadTranslations() protected method

protected loadTranslations ( string $path )
$path string

setPrefix() public method

public setPrefix ( string $prefix )
$prefix string

setTranslationsPrefix() public method

public setTranslationsPrefix ( string $prefix )
$prefix string

Property Details

$cache protected property

protected array $cache
return array

$indexes protected static property

protected static array $indexes
return array

$paths protected static property

protected static array $paths
return array

$prefix protected property

Path to resource files
protected string $prefix
return string

$translationsPrefix protected property

Path to translation files
protected string $translationsPrefix
return string