SQLToJSONConverter
class SQLToJSONConverter
This class allows the conversion of a SQL database to a json-schema.org compliant JSON database
Properties
private array | $parameters | ||
private array | $types | ||
private string | $databasesDir | ||
private SimpleXMLElement | $datasources | ||
private int | $maxId |
Methods
void
__construct(array $fparameters, string $databasesDir)
Constructor of class SQLToJSONConverter
array
convert(SimpleXMLElement $datasource)
Transfers the schema and data from a data source into an array for conversion to JSON
The
getDatabase(SimpleXMLElement $datasource, bool $withDbName = true)
Returns a Database object for the database of a data source
array|null
array
string
guessType(string $value, string $priorType = '')
Guess the type of the value of a choice item
string|bool|int|float
castValue(string $value, string $type)
Casts a value according to its type.
Details
at line 155
void
__construct(array $fparameters, string $databasesDir)
Constructor of class SQLToJSONConverter
at line 169
array
convert(SimpleXMLElement $datasource)
Transfers the schema and data from a data source into an array for conversion to JSON
at line 299
protected The
getDatabase(SimpleXMLElement $datasource, bool $withDbName = true)
Returns a Database object for the database of a data source
at line 314
protected array|null
tableInfos(Database $database, string $table)
Returns the information on a table
at line 351
protected array
getData(Database $database, string $table, array $schema, array $required)
Returns all the rows of a table of a SQL database
at line 407
protected string
guessType(string $value, string $priorType = '')
Guess the type of the value of a choice item
at line 444
protected string|bool|int|float
castValue(string $value, string $type)
Casts a value according to its type.