PHP Interface Lazer\Classes\Helpers\FileInterface

Show file Open project: greg0/lazer-database

Public Methods

Method Description
exists ( ) : boolean Checking that file exists
get ( boolean $assoc = false ) : mixed Return decoded JSON
getPath ( ) : string Returning path to file
put ( object | array $data ) : boolean Saving encoded JSON to file
remove ( ) : boolean Removing file
setType ( string $type ) Set the file type
table ( string $name ) : File Setting name of table

Method Details

exists() public method

Checking that file exists
public exists ( ) : boolean
return boolean

get() public method

Return decoded JSON
public get ( boolean $assoc = false ) : mixed
$assoc boolean Returns object if false; array if true
return mixed (object|array)

getPath() public method

Returning path to file
public getPath ( ) : string
return string Path to file

put() public method

Saving encoded JSON to file
public put ( object | array $data ) : boolean
$data object | array
return boolean

remove() public method

Removing file
public remove ( ) : boolean
return boolean

setType() public method

Set the file type
public setType ( string $type )
$type string File type (data|config)

table() public static method

Setting name of table
public static table ( string $name ) : File
$name string
return File