PHPackages                             hfw/db - 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. hfw/db

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

hfw/db
======

Database CRUD by annotation

0.0.1(4y ago)14MITPHPPHP ~7.4

Since Jul 26Pushed 2y ago1 watchersCompare

[ Source](https://github.com/hfw/db)[ Packagist](https://packagist.org/packages/hfw/db)[ Docs](https://github.com/hfw/db)[ RSS](/packages/hfw-db/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (3)Used By (0)

Helix::DB
=========

[](#helixdb)

Database storage and access using annotations.

[![](https://camo.githubusercontent.com/e44cb10f5bdf54d3f990d3366f9207a875a3ea4939ba587851d1c16bc78353f3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d7e372e342d363636393939)](https://www.php.net)[![](https://camo.githubusercontent.com/fe9dd82ef39861260048015f3770ee3945e96389b84df55310ae7e4bf6ae8a8e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7061636b61676973742d613530)](https://packagist.org/packages/hfw/db)[![](https://camo.githubusercontent.com/5e0abb27bc77af909f6e0c7cd00eee168f348ba6cbde1d3b1bcb5789c20477fd/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c61636b)](LICENSE.txt)[![](https://camo.githubusercontent.com/170bbd2f1c8c6e1a7a777ab58fa57f11056e1530eb93f42f390af4a4da11d3bf/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6866772f64622f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/hfw/db)[![](https://camo.githubusercontent.com/4f4e31df12750b0e76cb9ed604c9ed8a1280662867cfe2fec14336480b29e0d7/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6866772f64622f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/hfw/db)

Documentation:

Class Annotations
-----------------

[](#class-annotations)

```
/**
 * @record my_table
 */
class MyClass implements Helix\DB\EntityInterface, ArrayAccess {

    use Helix\DB\AttributesTrait;

    /**
     * "id" is a required column.
     * @column
     * @var int
     */
    protected $id = 0;

    /**
     * @column
     * @var string
     */
    protected $myColumn;

    /**
     * @eav foo_eav
     * @var array
     */
    protected $attributes;

    /**
     * @return int
     */
    final public function getId() {
        return $this->id;
    }

}

```

- Columns must be named the same as their respective properties.
- EAV tables must have 3 columns: `entity`, `attribute`, and `value`.
    - `entity` must be a foreign key.
    - `entity` and `attribute` must form the primary key.

Interface Annotations
---------------------

[](#interface-annotations)

Interfaces can be annotated to act as junctions.

```
/**
 * @junction foo_bar
 * @foreign foo_id Foo
 * @foreign bar_id Bar
 */
interface FooBar { }

```

- The interfaces don't have to be implemented.
- The referenced classes may be identical.

Supported Drivers
-----------------

[](#supported-drivers)

- MySQL
- SQLite

Class Diagram
-------------

[](#class-diagram)

[![](https://camo.githubusercontent.com/8187272488eae70683723f3102d01f2c0a4976250041b105ba8e03b9d2d134f5/68747470733a2f2f6866772e6769746875622e696f2f64622f636c61737365732e706e67)](https://hfw.github.io/db/inherits.html)

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

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 ~0 days

Total

2

Last Release

1753d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8cde1206945ba9660771b35de15d0bea7865c47594e0b5fabfa8590d6bd18172?d=identicon)[yoosefi](/maintainers/yoosefi)

---

Top Contributors

[![yoosefi](https://avatars.githubusercontent.com/u/2010434?v=4)](https://github.com/yoosefi "yoosefi (143 commits)")

---

Tags

migrationdatabasecrudannotation

### Embed Badge

![Health badge](/badges/hfw-db/health.svg)

```
[![Health](https://phpackages.com/badges/hfw-db/health.svg)](https://phpackages.com/packages/hfw-db)
```

###  Alternatives

[odan/phinx-migrations-generator

Migration generator for Phinx

235847.8k23](/packages/odan-phinx-migrations-generator)[dbout/wp-orm

WordPress ORM with Eloquent.

1279.6k1](/packages/dbout-wp-orm)[flobbos/laravel-crudable

A Laravel package for saving time on crud operations

1614.1k](/packages/flobbos-laravel-crudable)

PHPackages © 2026

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