PHPackages                             n0nag0n/super-model - 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. n0nag0n/super-model

ActiveLibrary

n0nag0n/super-model
===================

A simple base model you can extend to reduce your hard coded SQL queries and get 90% of your db requests done quick.

v0.1.0(6y ago)6111MITPHPCI failing

Since May 5Pushed 2y ago1 watchersCompare

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

READMEChangelog (1)DependenciesVersions (3)Used By (0)

[![Dependencies](https://camo.githubusercontent.com/e835c0c82683f1fec55c50847fc03cf2ed682efa9a89e90522122d925a53de2b/68747470733a2f2f64617669642d646d2e6f72672f6e306e6167306e2f73757065722d6d6f64656c2e737667)](https://camo.githubusercontent.com/e835c0c82683f1fec55c50847fc03cf2ed682efa9a89e90522122d925a53de2b/68747470733a2f2f64617669642d646d2e6f72672f6e306e6167306e2f73757065722d6d6f64656c2e737667)[![Build Status](https://camo.githubusercontent.com/64f22b03bc3e38ecd36b45df5fc19d18acbd056e2762bfc46e9c5aad1deb5fe3/68747470733a2f2f7472617669732d63692e6f72672f6e306e6167306e2f73757065722d6d6f64656c2e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/n0nag0n/super-model)[![codecov](https://camo.githubusercontent.com/de5bc02152489a87efd0151deffd2e404321421d81276c77983a4a9146644088/68747470733a2f2f636f6465636f762e696f2f67682f6e306e6167306e2f73757065722d6d6f64656c2f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/n0nag0n/super-model)[![contributions welcome](https://camo.githubusercontent.com/9e93e892d0685e1bf7a1d0bd7c8410d6ecf2086a0a7b48dd58a6b96fa556ea2a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f6e747269627574696f6e732d77656c636f6d652d627269676874677265656e2e7376673f7374796c653d666c6174)](https://github.com/dwyl/esta/issues)[![HitCount](https://camo.githubusercontent.com/9d773f6b1f5450943a893bbe41e107c3f2adb7dd046add74df1deb41687cb2cb/687474703a2f2f686974732e6477796c2e636f6d2f6e306e6167306e2f73757065722d6d6f64656c2e737667)](http://hits.dwyl.com/n0nag0n/super-model)

Update
======

[](#update)

It is highly recommended that you use [flightphp/active-record](https://github.com/flightphp/active-record) instead of this library. No further development will be done with this library, but it does work as it is right now.

Super Model
===========

[](#super-model)

Super model is a very simple ORM type php class to easily interact with tables in a database without writing a ton of SQL code all over the place.

To prove it, here are the lines of code...

```
$ cloc src/
       1 text file.
       1 unique file.
       0 files ignored.

github.com/AlDanial/cloc v 1.74  T=0.01 s (71.8 files/s, 48768.5 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
PHP                              1             86            246            347
-------------------------------------------------------------------------------

```

This is written with performance in mind. So while it will not satisfy every single requirement in every project that's ever been built, it will work in the majority of cases, and do a kick butt job at it too!

Basic Usage
-----------

[](#basic-usage)

Getting started with Super Model is easy, simply extend the super model class and define a table name. That's about it.

```
