PHPackages                             mcred/phpred - 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. mcred/phpred

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

mcred/phpred
============

Relationships, Entities and Datasources for PHP

0.0.5(8y ago)186MITPHP

Since Aug 30Pushed 8y ago1 watchersCompare

[ Source](https://github.com/mcred/phpred)[ Packagist](https://packagist.org/packages/mcred/phpred)[ RSS](/packages/mcred-phpred/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (3)Dependencies (5)Versions (4)Used By (0)

PHPRed
======

[](#phpred)

[![Build Status](https://camo.githubusercontent.com/e65d5da388098916a8fee0819d593ff5206a0fd74c1e6f8418e07064a421d9fb/68747470733a2f2f7472617669732d63692e6f72672f6d637265642f7068707265642e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/mcred/phpred)[![Code Climate](https://camo.githubusercontent.com/a31712fa63ac1537f34ba10c1e6caa5f585f0d46d8df8b904b16ced92bbc77d4/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6d637265642f7068707265642f6261646765732f6770612e737667)](https://codeclimate.com/github/mcred/phpred)[![Test Coverage](https://camo.githubusercontent.com/101951237e2c11456e29faa8da03720e028a167a095dbb2a91fd090407bf16f5/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6d637265642f7068707265642f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/mcred/phpred/coverage)[![Issue Count](https://camo.githubusercontent.com/73a9997356b3af257d79140242d327a37850b057e09422272cbb4865e830c2a6/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6d637265642f7068707265642f6261646765732f69737375655f636f756e742e737667)](https://codeclimate.com/github/mcred/phpred)

### Description

[](#description)

PHPRed is an opinionated light weight ORM. While there are many available ORMs for PHP, many contain features that I have never used. PHPRed contains very basic methods and usage.

### Requirements

[](#requirements)

- PHP 7.1+
- Composer
- Mysqli

### Installation

[](#installation)

```
composer require mcred/phpred

```

### Setup

[](#setup)

In addition to the example below, there are examples available in the `tests/mocks` folder. Setting up a model is very easy: create a model class that extends the `PHPRed/Models/Model` class then define the properties of that model in the constructor. Such as:

```
