Recommend this page to a friend! |
![]() |
Info | Example | Screenshots | ![]() |
![]() |
![]() |
Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not enough user ratings | Total: 183 | All time: 8,686 This week: 660![]() |
Version | License | PHP version | Categories | |||
serialiazable 1.0.4 | The PHP License | 5 | PHP 5, Language |
Description | Author | |||
This class can perform automatic serialization of objects with getters. Innovation Award
|
<?php |
this helps to serialize php object
to use it call the static method called serilaizable which will take in the obect as parameter. see example below
$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"}
Allow contributions to make it faster and re-usable
Screenshots (1) | ||
![]() |
File | Role | Description | ||
---|---|---|---|---|
![]() |
||||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Example | Example script | ||
![]() ![]() |
Lic. | License text | ||
![]() ![]() |
Doc. | Documentation | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() |
Class | Class source |
![]() |
/ | .idea |
File | Role | Description | ||
---|---|---|---|---|
![]() |
||||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Data | Auxiliary data |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
![]() |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
90% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.