2017 © Pedro Peláez
 

library php-serializable

this helps to serialize php object

image

theophy/php-serializable

this helps to serialize php object

  • Saturday, April 8, 2017
  • by theo4u
  • Repository
  • 4 Watchers
  • 4 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

php-serializable

this helps to serialize php object, (*1)

how to

to use it call the static method called serilaizable which will take in the obect as parameter. see example below, (*2)

$user = new User();
$user->setFirstname("Theophilus");
$user->setLastname("Omoregbee");

$user->setStates(array(new State("Edo state", "ED"), new State("Lagos State", "LG")));
$user->setCountry(new Country("Nigeria","NG"));

$user->setRoles(array("ADMIN","DB MANAGER"));

$user->setEmail("theo4u@ymail.com");
$user->setPassword("1111");

//lets serialize our object now
echo json_encode(SerializeMe::serialize($user));

which will lead to this output {"firstname":"Theophilus","lastname":"Omoregbee","states":[{"name":"Edo state","code":"ED"},{"name":"Lagos State","code":"LG"}],"country":{"name":"Nigeria","code":"NG"},"dateCreated":1477351778,"roles":["ADMIN","DB MANAGER"],"email":"theo4u@ymail.com","password":"b59c67bf196a4758191e42f76670ceba"}, (*3)

Response Json, (*4)

Contributions

Allow contributions to make it faster and re-usable, (*5)

The Versions

08/04 2017

dev-master

9999999-dev

this helps to serialize php object

  Sources   Download

GPL-3.0

The Requires

  • php >=5.4.0

 

by theophy
by Theophilus Omoregbee

02/12 2016

1.0.0

1.0.0.0

this helps to serialize php object

  Sources   Download

GPL-3.0

The Requires

  • php >=5.4.0

 

by theophy