Download the PHP package thesalegroup/restorm without Composer

On this page you can find all versions of the php package thesalegroup/restorm. 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 restorm

SensioLabsInsight GitHub version Build Status Coverage Status

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

Documentation Contents

  1. Installation
  2. Quick Start
  3. Basic Usage
    1. Create Entities
    2. Create Configuration File
    3. Initialize Manager
  4. Internals
    1. "Find" Workflow
    2. "Persist" Workflow
  5. References
    1. Configuration Reference

Installation

To install RESTORM, run the following composer command:

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

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.

Basic Usage

The following steps will show you a very simple usage of RESTORM for a project. We will setup RESTORM to talk to an artificial endpoint at https://example.com/api which serves a RESTful API. For this example we're going to create a very simple set of entities that would be useful for a blog. These will include a Post entity which has an Author entity associated with it.

Create Entities

To start off we'll create some classes for our entities. An entity is simply a resource object that's managed by RESTORM. An entity has properties which are populated from RESTful API calls as well as any other methods or logic you wish to have in them. Let's create a simple Post class:

Entities are not required to extend any interfaces or classes in RESTORM - any class can become an entity. Notice as well that the Post::$id, Post::$title, and Post::$author are all private properties - this will not affect RESTORM's ability to manage these fields as it manages properties through reflection.

In our Post entity the "ID", "title", and "content" will all be simple scalar values from our API, but "author" is different; although this will be in integer in the API that represent the ID of an author, we'll instead want this property to be populated with an instance of Author. Before we create our configuration to do manage this and the other fields, let's create the Author class as well:

Create Configuration File

With our entity classes defined now it's time to move on to creating the configuration file. For this we're going to needs to know what URLs we need to call to get our entity data and what properties need populating on our entities. Let's assume for this example that we're going to need to talk to a RESTful endpoint at https://example.com/api. We'll add in the the following configuration file that will set up the connection details and the entity mappings:

You can view the full configuration reference here:

Initialize Manager

The entity manager is the heart of RESTORM. It controls entities as they go to and from the connections and connects each internal component. Let's create a simple script that creates a new EntityManager and fetches all our posts:

With the EntityManager instantiated it can now be used to fetch entites:


All versions of restorm with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1
guzzlehttp/guzzle Version ^6.0
symfony/yaml Version ^3
symfony/event-dispatcher Version ^3
ocramius/proxy-manager Version ^2.1
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 thesalegroup/restorm contains the following files

Loading the files please wait ....