PHP 클래스 Nwidart\Modules\Json

파일 보기 프로젝트 열기: nwidart/laravel-modules 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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