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

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

cathedral/db
============

Database Layer database interfaces and classes.

0.2.1(4y ago)0382MITPHPPHP &gt;=8.0

Since Jan 17Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/CathedralCode/db)[ Packagist](https://packagist.org/packages/cathedral/db)[ Docs](https://git.inane.co.za:3000/cathedral/db)[ RSS](/packages/cathedral-db/feed)WikiDiscussions develop Synced 1w ago

READMEChangelogDependencies (4)Versions (5)Used By (2)

Cathedral\\Db
=============

[](#cathedraldb)

> $Id$ ($Date$)

Database class for use with builder and its generated code.

Custom methods
--------------

[](#custom-methods)

There are a few custom methods you can create to easily modify your data before sending it to client.

- customQueryOptions
    - runs prior to data access
    - lets you modify where clauses
    - check query string values
- customResponseOptions
    - runs last, just prior to sending data
    - has full access to the json response object
- getListPost
    - runs after data fetched from db
- createPre
    - check data before db record gets created

```
/**
 * Gets the query string parameters for pagination
 *
 * @param array $options
 * @param array $params
 *
 * @return void
 */
public function customQueryOptions(&$options, $params): void {
    if (isset($params['fk_champions'])) $options['where']['fk_champions'] = intval($params['fk_champions']);
}

/**
 * Gets the query string parameters for pagination
 *
 * @param mixed $json
 * @return void
 */
public function customResponseOptions(&$json): void {
    /** @var JsonModel $json */
    $payload = $json->getVariable('payload');

    for ($i = 0; $i < \count($payload); $i++) $payload[$i]['champion'] = $this->_champions[$payload[$i]['fk_champions']];

    $json->setVariable('extra', ['champions' => $this->_champions]);
    $json->setVariable('payload', $payload);
}

/**
 * Modify the resultset
 *
 * @param mixed $data
 * @return void
 */
public function getListPost($data): void {
    $data->buffer();
    foreach($data as $d) $this->_champions[$d->Champion()->id] = $d->Champion()->name;
}

/**
 * Check data before creating record
 *
 * @param mixed $data
 * @return null|string error
 */
public function createPre(&$data): ?string {
    // check data
    return null;
}
    ```

## Auth configurations

...
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity47

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

Total

3

Last Release

1497d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1823594?v=4)[Philip Michael Raab](/maintainers/inanepain)[@inanepain](https://github.com/inanepain)

---

Top Contributors

[![inanepain](https://avatars.githubusercontent.com/u/1823594?v=4)](https://github.com/inanepain "inanepain (48 commits)")

---

Tags

laminasdbinanecathedral

### Embed Badge

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

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

###  Alternatives

[laminas/laminas-db

Database abstraction layer, SQL abstraction, result set abstraction, and RowDataGateway and TableDataGateway implementations

13922.5M206](/packages/laminas-laminas-db)[doctrine/doctrine-orm-module

Laminas Module that provides Doctrine ORM functionality

4407.3M293](/packages/doctrine-doctrine-orm-module)[doctrine/doctrine-module

Laminas Module that provides Doctrine basic functionality required for ORM and ODM modules

3957.9M116](/packages/doctrine-doctrine-module)[samsonasik/error-hero-module

A Hero for your Laminas and Mezzio application to trap php errors &amp; exceptions

5233.4k1](/packages/samsonasik-error-hero-module)[doctrine/doctrine-laminas-hydrator

Doctrine hydrators for Laminas applications

362.8M19](/packages/doctrine-doctrine-laminas-hydrator)[laminas-api-tools/api-tools-doctrine

Laminas API Tools Doctrine module

10633.9k5](/packages/laminas-api-tools-api-tools-doctrine)

PHPackages © 2026

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