PHPackages                             zeptech/clarinet - 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. zeptech/clarinet

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

zeptech/clarinet
================

Lightweight PHP ORM

3120PHP

Since Jul 31Pushed 11y ago2 watchersCompare

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

READMEChangelogDependenciesVersions (2)Used By (0)

ORMdr
=====

[](#ormdr)

Clarinet is an ORM for PHP with a syntax loosely based on JPA/Hibernate. However, Clarinet is nowhere near as feature rich as Hibernate. It is intended to be easy and fast to build with. This makes it ideal for small websites and prototyping.

Throughout this guide and the code, you will see the terms model and entity. Model is used to refer to the definition of something that can be persisted while entity is used to refer to an instance of a model.

---

NOTE: Although the documentation is being updated to more consistent in its use of these terms, there may be some spots where they are used interchangeably.

---

Install
-------

[](#install)

Composer: zeptech/clarinet

Model Classes
-------------

[](#model-classes)

Persistance information is extracted from model classes. Typically, each table in your database will be represented by a model class. An exception being link tables for a many-to-many relationship, which are handled transparently by Clarinet.

---

All annotations used for defining model classes are parsed according to the rules of the [php-annotations library](https://github.com/pgraham/php-annotations).

---

A model class must follow some simple conventions that make them look a lot like Java beans.

Each model class must annotated with @Entity:

```
