mugomes/mgtoon

Biblioteca para trabalhar com Token-Oriented Object Notation.

Installs: 0

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/mugomes/mgtoon

1.0.1 2025-11-10 23:56 UTC

This package is auto-updated.

Last update: 2025-11-10 23:57:56 UTC


README

MGTOON é uma biblioteca para trabalhar com Token-Oriented Object Notation no PHP.

Installation

composer require mugomes/mgtoon

Example

use MGTOON\MGTOON;

include_once(__DIR__ . '/vendor/autoload.php');

// Added Fields and primary key "name"
$toon = new MGTOON('user', ['name', 'email', 'active'], 'name');

// Added Items
$toon->create(['name' => 'Maria', 'email' => 'maria@localhost', 'active' => 1]);
$toon->create(['name' => 'João', 'email' => 'joao@localhost', 'active' => 0]);

// Query
echo "\nQuery\n";
print_r($toon->read());

// Update
echo "\n\nUpdate\n";
$toon->update('Maria', ['active' => 0]);

// Read
echo "\n\nRead\n";
print_r($toon->read('Maria'));

// Delete
echo "\n\nDelete\n";
$toon->delete('João');

// TOON
echo "\nTOON\n";
print_r($toon->toString());

// Validate
echo "\n\nValidate\n";
print_r($toon->validate($toon->toString(), 'name'));

Support

License

The MGTOON is provided under:

SPDX-License-Identifier: LGPL-2.1-only

Beign under the terms of the GNU Lesser General Public License version 2.1 only.

All contributions to the MGTOON are subject to this license.