PHPackages                             oihana/php-models - 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. [Caching](/categories/caching)
4. /
5. oihana/php-models

ActiveLibrary[Caching](/categories/caching)

oihana/php-models
=================

The Oihana PHP Models library

1.0.0(today)07↑2471.4%MPL-2.0PHPPHP &gt;=8.4CI passing

Since Jun 20Pushed todayCompare

[ Source](https://github.com/BcommeBois/oihana-php-models)[ Packagist](https://packagist.org/packages/oihana/php-models)[ Docs](https://github.com/BcommeBois/oihana-php-models)[ RSS](/packages/oihana-php-models/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (17)Versions (2)Used By (0)

Oihana PHP - Models
===================

[](#oihana-php---models)

[![Oihana PHP Models](https://raw.githubusercontent.com/BcommeBois/oihana-php-models/main/assets/images/oihana-php-models-logo-inline-512x160.png)](https://raw.githubusercontent.com/BcommeBois/oihana-php-models/main/assets/images/oihana-php-models-logo-inline-512x160.png)

A document model layer for PHP 8.4+: schema-aware models with composable CRUD, PDO and PSR-16 cache integration.

[![Latest Version](https://camo.githubusercontent.com/cb08bbdeaa7c66fd9e18b4368181c110431e4719b41b3f6e8969f49ede6f7f34/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f6968616e612f7068702d6d6f64656c732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/oihana/php-models)
[![Total Downloads](https://camo.githubusercontent.com/ae99979dd030a04d35f06881fb7260f0ff281597fb80a7ea6c30a6770db537ec/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f6968616e612f7068702d6d6f64656c732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/oihana/php-models)
[![License](https://camo.githubusercontent.com/c30709d7a886c07b5e317cbe07763f3ef354873d1a3f48d9cf1f645ae469ca0f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6f6968616e612f7068702d6d6f64656c732e7376673f7374796c653d666c61742d737175617265)](LICENSE)

📚 Documentation
---------------

[](#-documentation)

User guides (FR + EN), with narrative explanations and examples:

🇬🇧 **[English documentation](wiki/en/README.md)**🇫🇷 **[Documentation française](wiki/fr/README.md)**Getting started, models, CRUD traits, PDO, cache, signals.Démarrage, modèles, traits CRUD, PDO, cache, signaux.Auto-generated API reference (phpDocumentor):
👉

🚀 Features
----------

[](#-features)

- 📄 Document models with composable CRUD traits (list, get, count, insert, update, delete).
- 🗄️ PDO-backed models for relational sources.
- 🧬 Schema.org-aware models built on `org\schema\Thing`.
- ⚡ PSR-16 cache integration (Scrapbook) for collection caching.
- 📡 Signals &amp; notices for model lifecycle events.
- 🧪 Full unit-test coverage ensuring reliability and maintainability.

💡 Designed to be lightweight, testable, and compatible with any PHP 8.4+ project.

📦 Installation
--------------

[](#-installation)

> **Requires [PHP 8.4+](https://php.net/releases/)**

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

```
composer require oihana/php-models
```

✅ Tests &amp; coverage
----------------------

[](#-tests--coverage)

Run the full unit-test suite (PHPUnit, strict mode):

```
composer test
```

Run a single test case:

```
./vendor/bin/phpunit --filter DocumentsTraitTest
```

Measure coverage (requires Xdebug or PCOV):

```
composer coverage        # text + Clover + HTML under build/coverage/
composer coverage:md     # readable Markdown summary (build/coverage/COVERAGE.md)
```

The suite runs in **strict mode** and targets **100% line coverage**.

🧾 License
---------

[](#-license)

This project is licensed under the [Mozilla Public License 2.0 (MPL-2.0)](https://www.mozilla.org/en-US/MPL/2.0/).

👤 About the author
------------------

[](#-about-the-author)

- Author : Marc ALCARAZ (aka eKameleon)
- Mail :
- Website :

🛠️ Generate the Documentation
-----------------------------

[](#️-generate-the-documentation)

We use [phpDocumentor](https://phpdoc.org/) to generate the documentation into the ./docs folder.

### Usage

[](#usage)

Run the command :

```
composer doc
```

🔗 Related packages
------------------

[](#-related-packages)

- [oihana/php-core](https://github.com/BcommeBois/oihana-php-core) – core helpers and utilities used by this library.
- [oihana/php-traits](https://github.com/BcommeBois/oihana-php-traits) – reusable, composable object traits.
- [oihana/php-logging](https://github.com/BcommeBois/oihana-php-logging) – PSR-3 logging building blocks.
- [oihana/php-schema](https://github.com/BcommeBois/oihana-php-schema) – Schema.org value objects and resolvers.
- [oihana/php-signals](https://github.com/BcommeBois/oihana-php-signals) – lightweight signal/slot events.

###  Health Score

43

—

FairBetter than 90% of packages

Maintenance100

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

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

Unknown

Total

1

Last Release

0d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d234506e51778dd3d1d61b6c2af6f294ff963651b4aa509b595d3d2a77b7d89b?d=identicon)[ooop](/maintainers/ooop)

---

Top Contributors

[![ekameleon](https://avatars.githubusercontent.com/u/749032?v=4)](https://github.com/ekameleon "ekameleon (11 commits)")

---

Tags

cachecruddata-accessmodelpdophpphp8psr-11phppdocachecrudmodelsdocumentschema-org

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/oihana-php-models/health.svg)

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

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k532.1M19.4k](/packages/laravel-framework)[cakephp/cakephp

The CakePHP framework

8.8k19.1M1.7k](/packages/cakephp-cakephp)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.6k38.2k](/packages/matomo-matomo)[algolia/algoliasearch-client-php

API powering the features of Algolia.

69634.4M144](/packages/algolia-algoliasearch-client-php)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

749284.3k35](/packages/civicrm-civicrm-core)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)

PHPackages © 2026

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