Skip to content

JSON ​

Properties ​

jsonItems ​

php
public \JsonMachine\Items $jsonItems

Methods ​

import ​

php
public import(\MammothPHP\WoollyM\DataFrame $to = new DataFrame()): \MammothPHP\WoollyM\DataFrame

Parameters:

ParameterTypeDescription
$to\MammothPHP\WoollyM\DataFrame

toFile ​

Encodes a DataFrame into a JSON file

php
public toFile(string|\SplFileInfo $file, bool $overwriteFile = false, bool $pretty = false): void

Parameters:

ParameterTypeDescription
$filestring|\SplFileInfo
$overwriteFilebool
$prettybool

toString ​

Encodes a DataFrame array into a JSON string.

php
public toString(bool $pretty = false): string

pretty: Will "prettify" the rendered JSON (default: false)

Parameters:

ParameterTypeDescription
$prettybool

Throws:


itemsFromFile ​

Decodes a JSON string into a DataFrame array.

php
protected itemsFromFile(): void

Throws:


itemsFromString ​

php
protected itemsFromString(): void

importFromJsonItems ​

php
protected importFromJsonItems(\MammothPHP\WoollyM\DataFrame $df): void

Parameters:

ParameterTypeDescription
$df\MammothPHP\WoollyM\DataFrame

Inherited methods ​

fromFilePath ​

php
public static fromFilePath(string $path): static
  • This method is static.

Parameters:

ParameterTypeDescription
$pathstring

fromFileInfo ​

php
public static fromFileInfo(\SplFileInfo $file): static
  • This method is static.

Parameters:

ParameterTypeDescription
$file\SplFileInfo

fromString ​

php
public static fromString(string $input): static
  • This method is static.

Parameters:

ParameterTypeDescription
$inputstring

convertSplFileToString ​

php
protected convertSplFileToString(): string

import ​

php
public import(\MammothPHP\WoollyM\DataFrame $to = new DataFrame()): \MammothPHP\WoollyM\DataFrame
  • This method is abstract.

Parameters:

ParameterTypeDescription
$to\MammothPHP\WoollyM\DataFrame

toArray ​

php
public toArray(): array

fromDataFrame ​

php
public static fromDataFrame(\MammothPHP\WoollyM\DataFrame $df): static
  • This method is static.

Parameters:

ParameterTypeDescription
$df\MammothPHP\WoollyM\DataFrame

prepareToFileInput ​

php
protected prepareToFileInput(mixed $file, bool $overwriteFile): \SplFileObject|false

Parameters:

ParameterTypeDescription
$filemixed
$overwriteFilebool


Automatically generated on 2024-07-03

Released under the BSD 3-Clause License.