PHPackages                             php-platform/persist - 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. php-platform/persist

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

php-platform/persist
====================

v0.1.12(8y ago)11.3k[1 issues](https://github.com/PHPPlatform/persist/issues)1PHPPHP &gt;=5.5

Since Jan 23Pushed 8y ago1 watchersCompare

[ Source](https://github.com/PHPPlatform/persist)[ Packagist](https://packagist.org/packages/php-platform/persist)[ Docs](https://github.com/PHPPlatform/persist)[ RSS](/packages/php-platform-persist/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (10)Dependencies (6)Versions (15)Used By (1)

PHP Platform Persistance APIs
=============================

[](#php-platform-persistance-apis)

This package allows persistence of PHP models (Objects)

[![Build Status](https://camo.githubusercontent.com/5a220fabb052e0e3f87cfd9346f5ebc7a9f31bfac4fcc112ab1d2058f909a751/68747470733a2f2f7472617669732d63692e6f72672f504850506c6174666f726d2f706572736973742e7376673f6272616e63683d76302e31)](https://travis-ci.org/PHPPlatform/persist)

Introduction
------------

[](#introduction)

This php library allows to convert relational schema to php objects

Features
--------

[](#features)

- Avoids SQL Queries in user source code
- Optimized Queries for all operations
- Dependency Injection
- built in search with sorting and pagination
- Annotations to map class and properties to table and columns
- Supports inheritance

### Example

[](#example)

Sample Class for a Table

```
use PhpPlatform\Persist\Model;

/**
 * @tableName t_normal1
 * @prefix TNormal1
 */
class TNormal1 extends Model {
    /**
     * @columnName F_PRIMARY_ID
     * @type integer
     * @primary
     * @autoIncrement
     * @get
     */
    private $fPrimaryId = null;

    /**
     * @columnName F_VARCHAR
     * @type varchar
     * @set
     * @get
     */
    private $fVarchar = null;

    /**
     * @columnName F_FOREIGN
     * @type integer
     * @set
     * @get
     */
    private $fForeign = null;

    function __construct($fPrimayId = null){
        $this->fPrimaryId = $fPrimayId;
        parent::__construct();
    }

    static function create( $fVarchar, $fForeign){
        $this->fVarchar = $fVarchar;
        $this->fForeign = $fForeign;
        parent::create();
    }

    static function find($filters){
        return parent::find($filters);
    }

    function delete(){
        parent::delete();
    }

    function setAttribute($name,$value){
        $args = array();
        $args[$name] = $value;
        $attrValues = $this->setAttributes($args);
    }

    function setAttributes($args){
        parent::setAttributes($args);
    }

    function getAttribute($name){
        $args = array();
        $args[] = $name;
        $attrValues = $this->getAttributes($args);
        return $attrValues[$name];
    }

    function getAttributes($args){
        return parent::getAttributes($args);
    }

}
```

For More Usage please see the included tests

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~34 days

Recently: every ~49 days

Total

14

Last Release

2958d ago

PHP version history (3 changes)v0.1.0PHP &gt;=5.3

v0.1.8PHP &gt;=5.4

v0.1.x-devPHP &gt;=5.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/92306cd4ec1342daeba6fb633880eb9907cdd022874ae39be11ab7ae274171c7?d=identicon)[Raaghu](/maintainers/Raaghu)

---

Top Contributors

[![Raaghu](https://avatars.githubusercontent.com/u/8255650?v=4)](https://github.com/Raaghu "Raaghu (41 commits)")

---

Tags

activerecordormpersistencephp-platformormOOPphp-platformPHP hibernaterelational Schema

### Embed Badge

![Health badge](/badges/php-platform-persist/health.svg)

```
[![Health](https://phpackages.com/badges/php-platform-persist/health.svg)](https://phpackages.com/packages/php-platform-persist)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[doctrine/doctrine-bundle

Symfony DoctrineBundle

4.8k241.3M3.3k](/packages/doctrine-doctrine-bundle)[doctrine/persistence

The Doctrine Persistence project is a set of shared interfaces and functionality that the different Doctrine object mappers share.

4.1k286.5M762](/packages/doctrine-persistence)[gedmo/doctrine-extensions

Doctrine behavioral extensions

4.1k118.8M366](/packages/gedmo-doctrine-extensions)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[beberlei/doctrineextensions

A set of extensions to Doctrine 2 that add support for additional query functions available in MySQL, Oracle, PostgreSQL and SQLite.

2.1k75.1M146](/packages/beberlei-doctrineextensions)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
