PHPackages                             robwasripped/restorm - 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. [Database &amp; ORM](/categories/database)
4. /
5. robwasripped/restorm

ActiveLibrary[Database &amp; ORM](/categories/database)

robwasripped/restorm
====================

REST ORM

v0.1.6(7mo ago)00[1 PRs](https://github.com/robwasripped/restorm/pulls)MITPHPPHP ^7.1 || ^8.0

Since Jul 4Pushed 3w agoCompare

[ Source](https://github.com/robwasripped/restorm)[ Packagist](https://packagist.org/packages/robwasripped/restorm)[ RSS](/packages/robwasripped-restorm/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (4)Versions (11)Used By (0)

[![SensioLabsInsight](https://camo.githubusercontent.com/64aabc64a5df4eee81cb3bcb0e3e88a7add88cadc7794592751e09c654b8c5c9/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f33646236393432382d336136302d343435322d393863642d3033663233663338386532322f6d696e692e706e67)](https://insight.sensiolabs.com/projects/3db69428-3a60-4452-98cd-03f23f388e22)[![GitHub version](https://camo.githubusercontent.com/cae5297474cb5fe173255fd41c01f93dcad1c9961d841ea9f3953199ad7c5be2/68747470733a2f2f62616467652e667572792e696f2f67682f74686573616c6567726f7570253246726573746f726d2e737667)](https://badge.fury.io/gh/thesalegroup%2Frestorm)[![Build Status](https://camo.githubusercontent.com/5e7ded302f7d692bd3c4991b4254190ed634ea5022c75f97eb8610d1cf52e063/68747470733a2f2f7472617669732d63692e6f72672f74686573616c6567726f75702f726573746f726d2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/thesalegroup/restorm)[![Coverage Status](https://camo.githubusercontent.com/aec70be0fc86f49c2e7ae974a08524c3514fc8c0431afeab6b43a7e04465fdb0/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f74686573616c6567726f75702f726573746f726d2f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/thesalegroup/restorm?branch=master)

RESTORM
=======

[](#restorm)

A REST ORM library for persisting data via an HTTP REST API. Inspired by Doctrine, RESTORM provides an entity manager to take care of persisting and loading your entities to and from a REST API.

Feature Overview
----------------

[](#feature-overview)

- 💾 Load and save entities from a RESTful API
- 👥 Manage data from multiple APIs
- 🔃 Manage unidirectional and bidirectional relationships between entities
- 💤 Effortlessly lazy load associated entities
- 🎈 Automated calls to paginated entities in loops
- 📝 Scalar, objects, and embedded entity types

Documentation Contents
======================

[](#documentation-contents)

1. [Installation](#installation)
2. [Quick Start](#quick-start)
3. [Basic Usage](#basic-usage)
    1. [Create Entities](#create-entities)
    2. [Create Configuration File](#create-configuration-file)
    3. [Initialize Manager](#initialize-manager)
4. Internals
    1. ["Find" Workflow](docs/Internals/Find.md)
    2. ["Persist" Workflow](docs/Internals/Persist.md)
5. References
    1. [Configuration Reference](docs/Reference/Configuration.md)

---

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

[](#installation)

To install RESTORM, run the following composer command:

```
composer install thesalegroup/restorm
```

If you haven't already done so, add the file autoloader from composer to your project code:

```
require __DIR__ . '/../vendor/autoload.php';
```

Development Container
---------------------

[](#development-container)

This repository includes a VS Code/Codespaces dev container for running the project toolchain in a consistent PHP environment. Mago is installed in the container image, not in the repository workspace.

The container uses PHP 8.4 because the current locked development toolchain, including PHPUnit 13, requires it. Mago still reads `mago.toml`, so analysis continues to target the project's PHP 8.1 code level.

After opening the repository in the container, the initial setup runs `composer install` so PHPUnit is ready to use. If `composer.json` or `composer.lock`changes later, rerun `composer install` inside the container before running the tools below.

```
vendor/bin/phpunit
mago lint
mago analyze
```

Quick Start
===========

[](#quick-start)

The example below can be used for reference for setting up a new project with RESTORM. For more information read through the rest of this guide which will link you to more documentation and references.

```
