PHP Class Caffeinated\Modules\Repositories\LocalRepository

Inheritance: extends Repository
Datei anzeigen Open project: caffeinated/modules

Public Methods

Method Description
all ( ) : Collection Get all modules.
count ( ) : integer Returns count of all modules.
disable ( string $slug ) : boolean Disables the specified module.
disabled ( ) : Collection Get all disabled modules.
enable ( string $slug ) : boolean Enables the specified module.
enabled ( ) : Collection Get all enabled modules.
exists ( string $slug ) : boolean Determines if the given module exists.
get ( string $property, mixed $default = null ) : mixed Get a module property value.
isDisabled ( string $slug ) : boolean Check if specified module is disabled.
isEnabled ( string $slug ) : boolean Check if specified module is enabled.
optimize ( ) : boolean Update cached repository of module information.
set ( string $property, mixed $value ) : boolean Set the given module property value.
slugs ( ) : Collection Get all module slugs.
sortBy ( string $key ) : Collection Sort modules by given key in ascending order.
sortByDesc ( string $key ) : Collection Sort modules by given key in ascending order.
where ( string $key, mixed $value ) : Collection Get modules based on where clause.

Private Methods

Method Description
createCache ( ) : Collection Create an empty instance of the cache file.
getCache ( ) : Collection Get the contents of the cache file.
getCachePath ( ) : string Get the path to the cache file.

Method Details

all() public method

Get all modules.
public all ( ) : Collection
return Collection

count() public method

Returns count of all modules.
public count ( ) : integer
return integer

disable() public method

Disables the specified module.
public disable ( string $slug ) : boolean
$slug string
return boolean

disabled() public method

Get all disabled modules.
public disabled ( ) : Collection
return Collection

enable() public method

Enables the specified module.
public enable ( string $slug ) : boolean
$slug string
return boolean

enabled() public method

Get all enabled modules.
public enabled ( ) : Collection
return Collection

exists() public method

Determines if the given module exists.
public exists ( string $slug ) : boolean
$slug string
return boolean

get() public method

Get a module property value.
public get ( string $property, mixed $default = null ) : mixed
$property string
$default mixed
return mixed

isDisabled() public method

Check if specified module is disabled.
public isDisabled ( string $slug ) : boolean
$slug string
return boolean

isEnabled() public method

Check if specified module is enabled.
public isEnabled ( string $slug ) : boolean
$slug string
return boolean

optimize() public method

Update cached repository of module information.
public optimize ( ) : boolean
return boolean

set() public method

Set the given module property value.
public set ( string $property, mixed $value ) : boolean
$property string
$value mixed
return boolean

slugs() public method

Get all module slugs.
public slugs ( ) : Collection
return Collection

sortBy() public method

Sort modules by given key in ascending order.
public sortBy ( string $key ) : Collection
$key string
return Collection

sortByDesc() public method

Sort modules by given key in ascending order.
public sortByDesc ( string $key ) : Collection
$key string
return Collection

where() public method

Get modules based on where clause.
public where ( string $key, mixed $value ) : Collection
$key string
$value mixed
return Collection