PHPackages                             kingsquare/communibase-databag - 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. kingsquare/communibase-databag

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

kingsquare/communibase-databag
==============================

Communibase dataBag

v2.1.0(5y ago)14.5k1[1 issues](https://github.com/kingsquare/communibase-databag/issues)[1 PRs](https://github.com/kingsquare/communibase-databag/pulls)1MITPHPPHP &gt;=7.3

Since Jun 13Pushed 5y ago2 watchersCompare

[ Source](https://github.com/kingsquare/communibase-databag)[ Packagist](https://packagist.org/packages/kingsquare/communibase-databag)[ RSS](/packages/kingsquare-communibase-databag/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (3)Dependencies (2)Versions (12)Used By (1)

Communibase DataBag
===================

[](#communibase-databag)

[![Build Status](https://camo.githubusercontent.com/d422641983a5e04c04cae0e668a86834c101547a65c1f840cd6cb8f63cc7fca4/68747470733a2f2f7472617669732d63692e6f72672f6b696e677371756172652f636f6d6d756e69626173652d646174616261672e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/kingsquare/communibase-databag)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/e2c669b280a03b76004258a81f11425d34c98eb4f28455e8039612cbefe4303e/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6b696e677371756172652f636f6d6d756e69626173652d646174616261672f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/kingsquare/communibase-databag/?branch=master)

It's a bag, for CB data. If we need to create a CB object from CB data (array) we can use this dataBag object as a private entity class property. The dataBag can contain one or more entities. For each entity we can get/set properties by path. If we need to persist the entity back into CB use getState to fetch the (updated) data array.

```
namespace Communibase;

/**
 * @author Kingsquare (source@kingsquare.nl)
 * @copyright Copyright (c) Kingsquare BV (http://www.kingsquare.nl)
 */
class ExamplePerson
{
    /**
     * @var DataBag
     */
    private $databag;

    /**
     * @param array $personData
     */
    private function __construct(array $personData)
    {
        $this->databag = DataBag::fromEntityData('person', $personData);
    }

    /**
     * @param array $personData
     */
    public static function fromPersonData(array $personData): ExamplePerson
    {
        return new self($personData);
    }

    public function getFirstName(): string
    {
        return (string)$this->databag->get('person.firstName');
    }

    public function setFirstName(string $firstName): void
    {
        $this->databag->set('person.firstName', $firstName);
    }

    /**
     * @return array
     */
    public function getState(): array
    {
        return $this->databag->getState('person');
    }
}

// $person = $personRepository->findById($communibasePersonId); // returns ExamplePerson::fromPersonData($fetchedCbData)
// $person->setFirstName('John');
// $personRepository->persist($person); // does $cbConnector->update('Person', $person->getState('person'));
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 64.5% 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 ~62 days

Recently: every ~88 days

Total

9

Last Release

2027d ago

Major Versions

v1.1.4 → v2.0.02020-10-01

PHP version history (3 changes)v1.0.0PHP &gt;=5.5

v2.0.1PHP &gt;=7.2

v2.1.0PHP &gt;=7.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/11c7a09c75d2f8770e8195931b2084a6a47ace4cfab44d9bacaf23cde7699273?d=identicon)[fruitl00p](/maintainers/fruitl00p)

![](https://www.gravatar.com/avatar/4316c5121fea35d4296c843de950bf4eaf035c721ec0f1ac3d0a4ac72959c27e?d=identicon)[mishavantol](/maintainers/mishavantol)

---

Top Contributors

[![mishavantol](https://avatars.githubusercontent.com/u/2063695?v=4)](https://github.com/mishavantol "mishavantol (40 commits)")[![fruitl00p](https://avatars.githubusercontent.com/u/1492861?v=4)](https://github.com/fruitl00p "fruitl00p (22 commits)")

---

Tags

communibasedatabagsphpdatabagcommunibase

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kingsquare-communibase-databag/health.svg)

```
[![Health](https://phpackages.com/badges/kingsquare-communibase-databag/health.svg)](https://phpackages.com/packages/kingsquare-communibase-databag)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M546](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

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