PHPackages                             c00/common - 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. [Framework](/categories/framework)
4. /
5. c00/common

ActiveLibrary[Framework](/categories/framework)

c00/common
==========

A mini framework for Database access, Dependency injection and Date manipulation.

0.13.0(7y ago)06282MITPHP

Since Sep 29Pushed 7y ago1 watchersCompare

[ Source](https://github.com/c00/common)[ Packagist](https://packagist.org/packages/c00/common)[ RSS](/packages/c00-common/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (1)Versions (76)Used By (2)

Common
======

[](#common)

A mini framework for common challenges such as database querying (ORM), dependency injection and date manipulation.

This is simply a personal usage toolkit that exists here for 2 reasons:

- So I can easily import it in my future projects with Composer
- To show potential employers code samples.

The Query Builder class is tested quite well. Not every SQL use case is covered, but the basic needs such as selects, joins, where, order by, group, max, avg, count are all covered.

\##Documentation This wil fill up slowly. I'm currently documenting the most important Features. But feel free to send me messages about something missing and I will expand. Feedback will motivate me to expand on this package.

It's currently still in Beta, tho I've the ORM portion extensively in a few different projects. Tests do cover most of the functionality.

### ORM - Super simple Database mappings

[](#orm---super-simple-database-mappings)

The ORM portion allows you to map Objects to the database with minimal setup. Objects just need to extend `AbstractDatabaseObject`. You can now save and query the database.

When just extending `AbstractDatabaseObject` without any extra setup, it will read and write to a database table of your choosing, mapping columns on property names. With a little setup it will use mapping of your choosing (including casting to your own objects). If that's still not enough you can override the `toArray()` and `fromArray()` functions to do the work yourself. (But that kind of defeats the purpose of having an ORM.)

Examples are found in the `showAndTell` folder. Short versions are found below:

\####Example 1: Get all users from the database

```
$allUsersQuery = Qry::select()
    ->from($userTable)
    ->asClass(User::class);

//All users will be an array over User objects.
$allUsers = $database->getRows($allUsersQuery);

```

\####Example 2: Get one user from the database

```
$getQuery = Qry::select()
    ->from($userTable)
    ->where('id', '=', 1)
    ->asClass(User::class);

$user = $database->getRow($getQuery);

```

\####Example 3: Insert a user to the database

```
$query = Qry::insert($userTable, $user);

$database->insertRow($query);

```

### Database - Easy and safe Database communications

[](#database---easy-and-safe-database-communications)

Connect to a MySQL / MariaDB database with PDO. Using the Querybuilder ensures proper prepared statements.

Docs coming soon...

### Qry - The querybuilder

[](#qry---the-querybuilder)

A Querybuilder that aims to stay as close to SQL as possible to minimize the learning curve. Automatically prepares your statements for you.

Automatically converts your objects to database-ready arrays and vice-versa.

Docs coming soon...

\###CovleDate - Date comparisons and casting Docs coming soon...

\###Settings - Easy setting saving and loading to a JSON file. Docs coming soon...

\###Dependencies - Simple dependency injection with type hinting Docs coming soon...

\#Todo:

- Bump to version 1.0
- Add a bunch of docs and samples.
- Use polymorphism for Qry. Make Qry abstract, and make select, update, insert and delete extend it.
- Retire old Query class

QueryBuilder
------------

[](#querybuilder)

- Add `->and` and `->or` support for where clauses and Join clauses

\#License - MIT So do whatever you want with it.

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity68

Established project with proven stability

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

Recently: every ~28 days

Total

72

Last Release

2556d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6259056?v=4)[Coo van Leeuwen](/maintainers/c00)[@c00](https://github.com/c00)

---

Top Contributors

[![c00](https://avatars.githubusercontent.com/u/6259056?v=4)](https://github.com/c00 "c00 (77 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/c00-common/health.svg)

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

###  Alternatives

[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k39.6M294](/packages/laravel-dusk)[nineinchnick/edatatables

Grid widget for the Yii Framework, wrapper for the DataTables jQuery plugin

173.2k](/packages/nineinchnick-edatatables)[link-cloud/fast-hyperf

LinkCloud Fast Hyperf

241.2k1](/packages/link-cloud-fast-hyperf)

PHPackages © 2026

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