PHPackages                             caridea/dao - 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. caridea/dao

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

caridea/dao
===========

A shrimp of a DAO support library

3.0.0(8y ago)05102Apache-2.0PHPPHP &gt;=7.1.0

Since Aug 20Pushed 8y ago1 watchersCompare

[ Source](https://github.com/libreworks/caridea-dao)[ Packagist](https://packagist.org/packages/caridea/dao)[ Docs](http://github.com/libreworks/caridea-dao)[ RSS](/packages/caridea-dao/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (4)Dependencies (5)Versions (8)Used By (2)

caridea-dao
===========

[](#caridea-dao)

Caridea is a miniscule PHP application library. This shrimpy fellow is what you'd use when you just want some helping hands and not a full-blown framework.

[![](https://camo.githubusercontent.com/3a9d2bd9abd336c1541d254cd07f8dff935288ad4a0983294f0b3f572f5b0f4b/687474703a2f2f6c69627265776f726b732e636f6d2f636172696465612d3130302e706e67)](https://camo.githubusercontent.com/3a9d2bd9abd336c1541d254cd07f8dff935288ad4a0983294f0b3f572f5b0f4b/687474703a2f2f6c69627265776f726b732e636f6d2f636172696465612d3130302e706e67)

This is its Data Access Object support component. You can use these classes to support DAOs that you write.

[![Packagist](https://camo.githubusercontent.com/0d2cceb0e8c11b882b61a2d24c49b240de0381e3db423496862f780d77d18d4f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636172696465612f64616f2e737667)](https://packagist.org/packages/caridea/dao)[![Build Status](https://camo.githubusercontent.com/378e2100beb83f404950e7d6c927aad0a1f6f69e7d062fea60b4b4c8cc684010/68747470733a2f2f7472617669732d63692e6f72672f6c69627265776f726b732f636172696465612d64616f2e737667)](https://travis-ci.org/libreworks/caridea-dao)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/741e458c9d2498fecc1fb2b5f8c7785850c3daeb84b079a6c3ff3e2e5f22a090/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6c69627265776f726b732f636172696465612d64616f2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/libreworks/caridea-dao/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/31215c6a0adf21250e0f35a19b14c0d830bbb93877a65df12c025c9b01c6e0b9/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6c69627265776f726b732f636172696465612d64616f2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/libreworks/caridea-dao/?branch=master)[![Documentation Status](https://camo.githubusercontent.com/7d79639e92111eccf826afcaa7ebe4ff6088527ea60ff7202bb4dc401facdcb4/687474703a2f2f72656164746865646f63732e6f72672f70726f6a656374732f636172696465612d64616f2f62616467652f3f76657273696f6e3d6c6174657374)](http://caridea-dao.readthedocs.io/en/latest/?badge=latest)

Installation
------------

[](#installation)

You can install this library using Composer:

```
$ composer require caridea/dao
```

- The master branch (version 3.x) of this project requires PHP 7.1 and depends on `caridea/event`.
- Version 2.x of this project requires PHP 7.0 and depends on `caridea/event`.

Compliance
----------

[](#compliance)

Releases of this library will conform to [Semantic Versioning](http://semver.org).

Our code is intended to comply with [PSR-1](http://www.php-fig.org/psr/psr-1/), [PSR-2](http://www.php-fig.org/psr/psr-2/), and [PSR-4](http://www.php-fig.org/psr/psr-4/). If you find any issues related to standards compliance, please send a pull request!

Documentation
-------------

[](#documentation)

- Head over to [Read the Docs](http://caridea-dao.readthedocs.io/en/latest/)

Features
--------

[](#features)

We provide a mechanism to translate vendor-specific exceptions (right now, MongoDB and Doctrine exceptions) into a standard exception hierarchy.

- `Conflicting` – An exception for concurrency failures.
- `Inoperable` – An exception for invalid API usage and configuration problems.
- `Locked` – An exception for unwritable records.
- `Unreachable` – An exception for connection problems.
- `Unretrievable` – An exception for unexpected results, for instance no results or too many results.
- `Violating` – An exception for constraint violations.
    - `Duplicative` – An exception for unique constraint violations.
- When all else fails, there's `Generic`.

We also provide abstract DAOs that allow you to make calls against your persistence API and have exceptions translated automatically.

```
class MyDao extends \Caridea\Dao\MongoDb
{
    public function create($record)
    {
        $this->logger->info("Creating the record");
        $this->doExecute(function ($manager, $collection) use ($record) {
            $bulk = new \MongoDB\Driver\BulkWrite();
            $bulk->insert($record);
            return $manager->executeBulkWrite($collection, $bulk);
        });
    }
}
```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity63

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

Recently: every ~126 days

Total

7

Last Release

3074d ago

Major Versions

2.0.x-dev → 3.0.02018-01-29

PHP version history (2 changes)2.0.0PHP &gt;=7.0.0

3.0.0PHP &gt;=7.1.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/659262eac941ffe4795493834425fc9a2369c2c9df3cc565ed4194f1d37be934?d=identicon)[doublecompile](/maintainers/doublecompile)

---

Top Contributors

[![doublecompile](https://avatars.githubusercontent.com/u/4267230?v=4)](https://github.com/doublecompile "doublecompile (11 commits)")

---

Tags

doctrineexceptionsdbmongodbdaodata access

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/caridea-dao/health.svg)

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

###  Alternatives

[mongodb/mongodb

MongoDB driver library

1.6k66.6M595](/packages/mongodb-mongodb)[friendsofsymfony/elastica-bundle

Elasticsearch PHP integration for your Symfony project using Elastica

1.3k17.7M49](/packages/friendsofsymfony-elastica-bundle)[omines/datatables-bundle

Symfony DataTables Bundle with native Doctrine ORM, Elastica and MongoDB support

2841.5M6](/packages/omines-datatables-bundle)[danielme85/laravel-log-to-db

Custom Laravel Log channel handler that can store log events to SQL or MongoDB databases. Uses Laravel native logging functionality.

134979.2k1](/packages/danielme85-laravel-log-to-db)[h4cc/alice-fixtures-bundle

Symfony2 Bundle for loading fixture data with the Alice library.

75314.5k7](/packages/h4cc-alice-fixtures-bundle)[mmucklo/queue-bundle

Symfony2/3/4/5 Queue Bundle (for background jobs) supporting Mongo (Doctrine ODM), Mysql (and any Doctrine ORM), RabbitMQ, Beanstalkd, Redis, and ... {write your own}

120911.4k](/packages/mmucklo-queue-bundle)

PHPackages © 2026

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