oihana/php-models

The Oihana PHP Models library

Maintainers

Package info

github.com/BcommeBois/oihana-php-models

pkg:composer/oihana/php-models

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

dev-main 2026-06-20 09:29 UTC

This package is auto-updated.

Last update: 2026-06-20 09:31:33 UTC


README

Oihana PHP Models

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

Latest Version
Total Downloads
License

📚 Documentation

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

🇬🇧 English documentation 🇫🇷 Documentation française
Getting started, models, CRUD traits, PDO, cache, signals. Démarrage, modèles, traits CRUD, PDO, cache, signaux.

Auto-generated API reference (phpDocumentor):
👉 https://bcommebois.github.io/oihana-php-models

🚀 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 & 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

Requires PHP 8.4+

Install via Composer:

composer require oihana/php-models

✅ 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

This project is licensed under the Mozilla Public License 2.0 (MPL-2.0).

👤 About the author

🛠️ Generate the Documentation

We use phpDocumentor to generate the documentation into the ./docs folder.

Usage

Run the command :

composer doc

🔗 Related packages