PHP Classes
elePHPant
Icontem

JSON Object Mapper: Create objects of classes mapped from JSON strings

Recommend this page to a friend!
  Info   View files Documentation   View files View files (41)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2018-04-27 (2 months ago) RSS 2.0 feedNot yet rated by the usersTotal: 141 All time: 8,647 This week: 244Up
Version License PHP version Categories
json-object-mapper 1.2.0Custom (specified...5.6PHP 5, Data types
Description Author

This class create objects of classes mapped from JSON strings.

It can take a given class and extracts the annotations to determine the type of its variables.

The class can parse a JSON string and extracts the values to store in the class variables according to the types defined in the annotations.

The class can also retrieve nested objects to be stored in the class variables declared as such.

Innovation Award
PHP Programming Innovation award winner
September 2017
Winner


Prize: One big elePHPant Plush Mascott
ORMs (Object Relational Mapping) are tools or libraries of code that are used to store and retrieve objects in databases or other types of storage containers.

To do their job, ORMs need to retrieve information from somewhere to determine how to store or retrieve the objects in the container.

This package provides means to retrieve mapping information from annotation comments that have that information defined as JSON data structure strings.

Manuel Lemos
  Performance   Level  
Name: Julian Finkler <contact>
Classes: 6 packages by
Country: Germany Germany
Age: 24
All time rank: 3474197 in Germany Germany
Week rank: 82 Up3 in Germany Germany Up
Innovation award
Innovation award
Nominee: 2x

Winner: 1x

Details

Travis Packagist GitHub license Packagist

JOM - JSON Object Mapper

JOM is a powerful object mapper which maps JSON Data into PHP objects.

Installation

You can install this library using composer

$ composer require mintware-de/json-object-mapper

Usage

Check out the documentation

Testing

$ phpunit

Contribute

Feel free to fork, contribute and create pull requests

  Files folder image Files  
File Role Description
Files folder imagedoc (7 files)
Files folder imagesrc (4 files, 1 directory)
Files folder imagetests (3 files, 3 directories)
Accessible without login Plain text file .travis.yml Data Auxiliary data
Accessible without login Plain text file CHANGELOG.md Doc. Documentation
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  doc  
File Role Description
  Accessible without login Plain text file 1_simple_mapping.md Doc. Documentation
  Accessible without login Plain text file 2_mapping_with_typehints.md Doc. Documentation
  Accessible without login Plain text file 3_mapping_alternative_property_names.md Doc. Documentation
  Accessible without login Plain text file 4_using_transformers.md Doc. Documentation
  Accessible without login Plain text file 5_convert_an_object_to_json.md Doc. Documentation
  Accessible without login Plain text file 6_multiple_annotations.md Doc. Documentation
  Accessible without login Plain text file index.md Doc. Documentation

  Files folder image Files  /  src  
File Role Description
Files folder imageException (4 files)
  Plain text file DateTimeField.php Class Class source
  Plain text file JsonField.php Class Class source
  Plain text file ObjectMapper.php Class Class source
  Plain text file TransformerInterface.php Class Class source

  Files folder image Files  /  src  /  Exception  
File Role Description
  Plain text file ClassNotFoundException.php Class Class source
  Plain text file InvalidJsonException.php Class Class source
  Plain text file PropertyNotAccessibleException.php Class Class source
  Plain text file TypeMismatchException.php Class Class source

  Files folder image Files  /  tests  
File Role Description
Files folder imageObjects (7 files)
Files folder imageres (7 files)
Files folder imageTransformer (3 files)
  Accessible without login Plain text file autoload.php Aux. Auxiliary script
  Plain text file FailPerson.php Class Class source
  Plain text file ObjectMapperTest.php Class Class source

  Files folder image Files  /  tests  /  Objects  
File Role Description
  Plain text file Address.php Class Class source
  Plain text file Autobot.php Class Class source
  Accessible without login Plain text file OtherAnnotation.php Test Unit test script
  Plain text file Person.php Class Class source
  Plain text file PersonWithEscapedFQCN.php Class Class source
  Plain text file PersonWithMultipleAddresses.php Class Class source
  Accessible without login Plain text file SimplePerson.php Test Unit test script

  Files folder image Files  /  tests  /  res  
File Role Description
  Accessible without login Plain text file person.json Data Auxiliary data
  Accessible without login Plain text file person_field_variation.json Data Auxiliary data
  Accessible without login Plain text file person_multiple.json Data Auxiliary data
  Accessible without login Plain text file person_multiple_addresses.json Data Auxiliary data
  Accessible without login Plain text file person_protected.json Data Auxiliary data
  Accessible without login Plain text file person_string_address.json Data Auxiliary data
  Accessible without login Plain text file transformer.json Data Auxiliary data

  Files folder image Files  /  tests  /  Transformer  
File Role Description
  Plain text file MicrotimeTransformer.php Class Class source
  Plain text file PaddingTransformer.php Class Class source
  Plain text file TagTransformer.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:141
This week:0
All time:8,647
This week:244Up