FileAccess Orion

Extras

Trait extras

Extend the object to support additional extras stored next to it as a folder

Table of Contents

CreateExtra()  : Result
Create a new extra
DeleteExtra()  : Result
Delete the extra
FetchExtras()  : Result
Fetch extra list
GetExtra()  : Result
Fetch single extra
UpdateExtra()  : Result
Update the extra
extrasPath()  : string
Helper to get the extras path
writeExtra()  : Result
Store extras

Methods

CreateExtra()

Create a new extra

public CreateExtra(string $type, array<string|int, mixed> $data[, bool $individual = true ]) : Result
Parameters
$type : string
$data : array<string|int, mixed>
$individual : bool = true
Return values
Result

DeleteExtra()

Delete the extra

public DeleteExtra(string $type[, string|null $id = null ][, bool $individual = true ]) : Result
Parameters
$type : string

The extras type

$id : string|null = null

The id or null to drop all of certain kind

$individual : bool = true

Is individual file or, in all full list?

Return values
Result

FetchExtras()

Fetch extra list

public FetchExtras(string $type[, bool $individual = true ]) : Result
Parameters
$type : string
$individual : bool = true
Return values
Result

GetExtra()

Fetch single extra

public GetExtra(string $type, string $id) : Result
Parameters
$type : string
$id : string
Return values
Result

UpdateExtra()

Update the extra

public UpdateExtra(string $type, string $id, array<string|int, mixed> $data[, bool $individual = true ]) : Result
Parameters
$type : string

The extras type

$id : string

The item primary key

$data : array<string|int, mixed>

The new data

$individual : bool = true

Is individual file or in all full list?

Return values
Result

extrasPath()

Helper to get the extras path

private extrasPath(string $type) : string
Parameters
$type : string
Return values
string

writeExtra()

Store extras

private writeExtra(string $file, array<string|int, mixed> $data[, bool $individual = true ]) : Result
Parameters
$file : string

The target file

$data : array<string|int, mixed>

The new row

$individual : bool = true

Save in individual file?

Return values
Result

Search results