Download the PHP package freddiegar/json-api-mapper without Composer

On this page you can find all versions of the php package freddiegar/json-api-mapper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package json-api-mapper

JSON Api Mapper

It is a mapper in PHP from response jsonapi.org.

This library create a object from response json-api. Access to elements in response easily

Status Branch

master: Build Status develop: Build Status v1.0.0: Build Status

Requisites

Install

Usage

Creating instance of Mapper, see $jsonApiResponse here

By example, get data resource

By example, get included

By example, get errors, see $jsonApiResponse here

Find

Get data with id = 2

Get included by type = people

Get included with type = people and id = 3

Alias in JsonApiResponse class

You can use any option to access to data in that response

Method* Alias Property Description
getData() data() data Return object DataMapper if exists in response, else null
getErrors() errors() errors Return object ErrorsMapper if exists in response, else null
getMeta() meta() meta Return object MetaMapper if exists in response, else null
getJsonApi() jsonapi() jsonapi Return object JsonApiMapper if exists in response, else null
getIncluded() included() included Return object IncludedMapper if exists in response, else null
getLinks() links() links Return object LinksMapper if exists in response, else null

Performance

You will prefer to use get* (getData(), getErrors()) methods accessors, they are direct call, any other ways are overloading (__call and __get), this are slower

Response Used In Example

You can see all example here

Response json-api Resource used in this example

Response json-api Errors used in this example

License

MIT


All versions of json-api-mapper with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1.3
dflydev/dot-access-data Version v2.0.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package freddiegar/json-api-mapper contains the following files

Loading the files please wait ....