PHPackages                             phpwax/slimmodel - 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. phpwax/slimmodel

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

phpwax/slimmodel
================

Lightweight Model Package

026PHP

Since Feb 13Pushed 12y ago3 watchersCompare

[ Source](https://github.com/phpwax/slimmodel)[ Packagist](https://packagist.org/packages/phpwax/slimmodel)[ RSS](/packages/phpwax-slimmodel/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Slim-Model
----------

[](#slim-model)

### A lighter ORM style wrapper for Doctrine DBAL

[](#a-lighter-orm-style-wrapper-for-doctrine-dbal)

Slim-Model is a small library that wraps Doctrine DBAL allowing fast prototypes , whilst keeping many of the features of the original gargantuan library.

This package delegates all the heavy lifting to Doctrine/DBAL and throws out the concept of complex objects for models and fields. Instead, everything returned is a plain PHP object.

### What Slim-Model Can Do

[](#what-slim-model-can-do)

#### Automatic Databaase Syncing

[](#automatic-databaase-syncing)

In development mode, Slim-model can automatically sync the database to columns defined in the `define()` method. Model objects can also be set to frozen when this behaviour is no longer required.

As before the sync will be triggered automatically whenever a query cannot run because of a schema exception.

How to install
--------------

[](#how-to-install)

Via composer, just add the following to any project's `composer.json` file.

```
"require": {
  "rossriley/slimmodel": "1.0.*@dev"
}

```

Then define your models to extend the Base class, like below..

```
