PHPackages                             enygma/modler - 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. enygma/modler

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

enygma/modler
=============

A basic model library

2.1.4(10y ago)166.3k↓37.5%8[4 issues](https://github.com/enygma/modler/issues)2MITPHPPHP &gt;=5.4

Since Sep 26Pushed 8y ago1 watchersCompare

[ Source](https://github.com/enygma/modler)[ Packagist](https://packagist.org/packages/enygma/modler)[ Docs](https://github.com/enygma/modler.git)[ RSS](/packages/enygma-modler/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (21)Used By (2)

Modler: a generic model layer for PHP
=====================================

[](#modler-a-generic-model-layer-for-php)

[![Build Status](https://camo.githubusercontent.com/7fb6ed6aedfc6d55da831d59c63e9902bec6e916ac04a7e11a2fab05c6775cf1/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f656e79676d612f6d6f646c65722e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/enygma/modler)

Modler is a set of scripts that provide some of the most basic model and collection handling pieces of functionality.

Installation
------------

[](#installation)

You can install the library via Composer using the `require` command:

```
composer require enygma/modler

```

Classes
-------

[](#classes)

### Model

[](#model)

The Model class helps to model out an object with properties and relationships. A model is defined with a set of `properties` that can either be literal values or relationships to other models. Here's an example of a simple model:

```
