PHPackages                             jgswift/persistr - 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. jgswift/persistr

ActiveLibrary

jgswift/persistr
================

PHP 5.5+ lightweight persistence layer

0.1.1(11y ago)05MITPHPPHP &gt;=5.5

Since Jun 2Pushed 11y ago1 watchersCompare

[ Source](https://github.com/jgswift/persistr)[ Packagist](https://packagist.org/packages/jgswift/persistr)[ RSS](/packages/jgswift-persistr/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

persistr
========

[](#persistr)

PHP 5.5+ lightweight persistence layer

[![Build Status](https://camo.githubusercontent.com/2f9ec9ccab4becf7a14cb0885ac5e3c80dee9277f60a6cb75d3601cab4537921/68747470733a2f2f7472617669732d63692e6f72672f6a6773776966742f70657273697374722e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/jgswift/persistr)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/1c91c66d78700ce024e35ae95fe853456cfc721e7f587500f7e7a0ece88d162e/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6a6773776966742f70657273697374722f6261646765732f7175616c6974792d73636f72652e706e673f733d39366566356232633062616163643164623566356262636364323330353764653133386632383232)](https://scrutinizer-ci.com/g/jgswift/persistr/)

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

[](#installation)

Install via [composer](https://getcomposer.org/):

```
php composer.phar require jgswift/persistr:dev-master
```

Usage
-----

[](#usage)

persistr is a lightweight php package which implements a loose persistence layer.

persistr does not necessarily use annotations or otherwise any kind of model metadata when defining models. However, that does not preclude the inclusion of a formal modeling component

Additionally, persistr Models may be solely relied on for any data source transactions. It is typically bad practice to put platform-dependant code in the Persistent interface implementation. Such code is only appropriate on the model itself.

persistr assumes you know how to interact with your respective data-source and is not a full-on database abstraction layer

persistr makes the distinction between persistence implementations for objects based on signature criteria such as the presence of traits, interfaces, or even simply an individual class name alone

When persistence is applied to an individual class, all inheriting classes naturally have the same extensions by default

The following is a default example with a blank model using an interface/trait pair signature (the interface is the distinct element by default)

```
