Skip to content

atphp/serializer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Serializer Build Status Latest Stable Version License

Very simple Serializer/Unserializer for PHP objects.

If we have this very simple class:

<?php
class Person {
    private $name;
    public function getName() { return $this->name; }
    public function setName($name) { $this->name = $name; }
}

Then we can easy create new Person object from a structured array:

<?php
$person = new Person();
$person->setName('Johnson American');
(new AndyTruong\Serializer\Serializer())
    ->toArray($person); // ['name' => 'Johnson American']

We can also easy create new Person object from a structured array:

<?php
$person = (new AndyTruong\Serializer\Unserializer())
    ->fromArray(['name' => 'Johnson America']);

The library also supports Trait, nested objects, … check ./resources/docs for more informations.

About

Very simple library to serialize/unserialize PHP objects.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages