PHP Класс Nwidart\Modules\Json

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$attributes Illuminate\Support\Collection The attributes collection.
$filesystem Illuminate\Filesystem\Filesystem The laravel filesystem instance.
$path string The file path.

Открытые методы

Метод Описание
__call ( string $method, array $arguments = [] ) : mixed Handle call to __call method.
__construct ( mixed $path, Illuminate\Filesystem\Filesystem $filesystem = null ) The constructor.
__get ( string $key ) : mixed Handle magic method __get.
__toString ( ) : string Handle call to __toString method.
get ( $key, null $default = null ) : mixed Get the specified attribute from json file.
getAttributes ( ) : array Get file contents as array.
getContents ( ) : string Get file content.
getFilesystem ( ) : Illuminate\Filesystem\Filesystem Get filesystem.
getPath ( ) : string Get path.
make ( string $path, Illuminate\Filesystem\Filesystem $filesystem = null ) : static Make new instance.
save ( ) : boolean Save the current attributes array to the file storage.
set ( string $key, mixed $value ) Set a specific key & value.
setFilesystem ( Illuminate\Filesystem\Filesystem $filesystem ) Set filesystem.
setPath ( mixed $path ) Set path.
toJsonPretty ( array $data = null ) : string Convert the given array data to pretty json.
update ( array $data ) : boolean Update json contents from array data.

Описание методов

__call() публичный Метод

Handle call to __call method.
public __call ( string $method, array $arguments = [] ) : mixed
$method string
$arguments array
Результат mixed

__construct() публичный Метод

The constructor.
public __construct ( mixed $path, Illuminate\Filesystem\Filesystem $filesystem = null )
$path mixed
$filesystem Illuminate\Filesystem\Filesystem

__get() публичный Метод

Handle magic method __get.
public __get ( string $key ) : mixed
$key string
Результат mixed

__toString() публичный Метод

Handle call to __toString method.
public __toString ( ) : string
Результат string

get() публичный Метод

Get the specified attribute from json file.
public get ( $key, null $default = null ) : mixed
$key
$default null
Результат mixed

getAttributes() публичный Метод

Get file contents as array.
public getAttributes ( ) : array
Результат array

getContents() публичный Метод

Get file content.
public getContents ( ) : string
Результат string

getFilesystem() публичный Метод

Get filesystem.
public getFilesystem ( ) : Illuminate\Filesystem\Filesystem
Результат Illuminate\Filesystem\Filesystem

getPath() публичный Метод

Get path.
public getPath ( ) : string
Результат string

make() публичный статический Метод

Make new instance.
public static make ( string $path, Illuminate\Filesystem\Filesystem $filesystem = null ) : static
$path string
$filesystem Illuminate\Filesystem\Filesystem
Результат static

save() публичный Метод

Save the current attributes array to the file storage.
public save ( ) : boolean
Результат boolean

set() публичный Метод

Set a specific key & value.
public set ( string $key, mixed $value )
$key string
$value mixed

setFilesystem() публичный Метод

Set filesystem.
public setFilesystem ( Illuminate\Filesystem\Filesystem $filesystem )
$filesystem Illuminate\Filesystem\Filesystem

setPath() публичный Метод

Set path.
public setPath ( mixed $path )
$path mixed

toJsonPretty() публичный Метод

Convert the given array data to pretty json.
public toJsonPretty ( array $data = null ) : string
$data array
Результат string

update() публичный Метод

Update json contents from array data.
public update ( array $data ) : boolean
$data array
Результат boolean

Описание свойств

$attributes защищенное свойство

The attributes collection.
protected Collection,Illuminate\Support $attributes
Результат Illuminate\Support\Collection

$filesystem защищенное свойство

The laravel filesystem instance.
protected Filesystem,Illuminate\Filesystem $filesystem
Результат Illuminate\Filesystem\Filesystem

$path защищенное свойство

The file path.
protected string $path
Результат string