PHPackages                             tystr/rest-orm - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. tystr/rest-orm

ActiveLibrary[HTTP &amp; Networking](/categories/http)

tystr/rest-orm
==============

A simple ORM-like library handling object persistence with a RESTful API.

v0.6.0(8y ago)71.8k3[1 PRs](https://github.com/tystr/rest-orm/pulls)1MITPHPPHP &gt;=7.0

Since Oct 1Pushed 7y ago1 watchersCompare

[ Source](https://github.com/tystr/rest-orm)[ Packagist](https://packagist.org/packages/tystr/rest-orm)[ RSS](/packages/tystr-rest-orm/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (7)Versions (17)Used By (1)

RestOrm
=======

[](#restorm)

[![Build Status](https://camo.githubusercontent.com/856349634f7d92badb363afe7ea05ee4dbcffa9d444204708fde30ed4be1b428/68747470733a2f2f7472617669732d63692e6f72672f74797374722f726573742d6f726d2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/tystr/rest-orm)[![Test Coverage](https://camo.githubusercontent.com/8ea7f7bbb85b1555da71c40fd6378da73997b2a5d412affb2aeb34a042f20e6c/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f74797374722f726573742d6f726d2f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/tystr/rest-orm/coverage)[![Packagist](https://camo.githubusercontent.com/0ef7f80db44417ccada83532329211be111253ff6c1ea83004ccb9d8dfb509aa/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f74797374722f726573742d6f726d2e737667)](https://packagist.org/packages/tystr/rest-orm)[![Downloads](https://camo.githubusercontent.com/225f7644920ed01ef60d886be6a1cbf10229bf6c3aa26157b8f9f59040aedf7d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f74797374722f726573742d6f726d2e737667)](https://packagist.org/packages/tystr/rest-orm)

***Note: as of `v0.6.0` this library depends on `PHP 7.x`.***

A simple ORM-like package for handling object persistence using a RESTful API.

Installation
============

[](#installation)

Install `tystr/rest-orm` with composer:

```
# composer.phar require tystr/rest-orm:~0.1

```

Configuration
=============

[](#configuration)

For each of your models you need to add mapping configuration and set up a `Repository` instance.

Mapping
-------

[](#mapping)

RestOrm provides 2 annotations which must be used on each model:

- `@Resource` This configures the name of the rest resource to use when generating urls.
- `@Id` This configures the property to use as the identifier.

Data is hydrated into the models using [JMS Serializer](http://jmsyst.com/libs/serializer). See the documentation [here](http://jmsyst.com/libs/serializer/master/reference) for information on how to add mapping for your models.

```
