PHPackages                             sugatasei/bredala-data - 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. sugatasei/bredala-data

ActiveLibrary

sugatasei/bredala-data
======================

PHP modeling and data manipulation class

5.0.0(1y ago)09MITPHPPHP &gt;=8.1.0

Since Aug 5Pushed 1y ago1 watchersCompare

[ Source](https://github.com/sugatasei/bredala-data)[ Packagist](https://packagist.org/packages/sugatasei/bredala-data)[ RSS](/packages/sugatasei-bredala-data/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (2)DependenciesVersions (10)Used By (0)

bredala-data
============

[](#bredala-data)

PHP modeling and data manipulation tools.

Data
----

[](#data)

`Data` is designed to be extends to help create entities, models, ...

`Data` implements `JsonSerializable` for all public non static properties.

MicroCache
----------

[](#microcache)

Micro-caching tools. Store data only during the script execution.

```
use Bredala\Data\MicroCache;

if (null === ($foo = MicroCache::get('foo'))) {
    $foo = 'bar';
    MicroCache::set('foo', $foo);
}
```

Special use : the value can be null

```
use Bredala\Data\MicroCache;

if (null === ($nullable = MicroCache::get('nullable')) && !MicroCache::has('nullable')) {
    $nullable = null;
    MicroCache::set('nullable', $nullable);
}
```

ArrayHelper
-----------

[](#arrayhelper)

### Extract part of array

[](#extract-part-of-array)

Creates an array from another array keeping only certain keys.

```
use Bredala\Data\ArrayHelper;

$arry = ArrayHelper::extract([
    'id' => 1,
    'name' => 'John Doe',
    'city' => 'London'
], ['id', 'name']);
```

### Extract part of array

[](#extract-part-of-array-1)

Creates an array from another array keeping only certain keys.

```
use Bredala\Data\ArrayHelper;

$ary = ArrayHelper::extract([
    'id' => 1,
    'name' => 'John Doe',
    'city' => 'London'
], ['id', 'name']);
```

### Rename keys

[](#rename-keys)

Rename a keys from an array

```
use Bredala\Data\ArrayHelper;

$ary = ArrayHelper::renameKeys([
    'id' => 1,
    'name' => 'John Doe',
    'city' => 'London'
], [
    'id' => 'user_id'
]);
```

### Add prefix to keys

[](#add-prefix-to-keys)

```
use Bredala\Data\ArrayHelper;

$ary = ArrayHelper::addPrefix([
    'id' => 1,
    'name' => 'John Doe',
    'city' => 'London'
], 'user_');
```

### Remove prefix to keys

[](#remove-prefix-to-keys)

```
use Bredala\Data\ArrayHelper;

$ary = ArrayHelper::removePrefix([
    'user_id' => 1,
    'user_name' => 'John Doe',
    'user_city' => 'London'
], 'user_');
```

Encoder/Decoder
---------------

[](#encoderdecoder)

Encoders helps to transform PHP data to storage type. Decoders helps to tranform data from storage to PHP type.

Encoders &amp; Decoders are usefull inside adapters.

- `BooleanEncoder` Encode/Decode 0-1 integer to/from PHP boolean
- `DataEncoder` Encode/Decode array to/from `Data` object
- `DataListEncoder` : Encode/Decode array of array to/from array of `Data` objects
- `DateTimeEncoder` : Encode/Decode date with string representation to/from PHP DateTime objects
- `JsonEncoder`
- `TimestampEncoder` : Encode/Decode date with string representation to/from PHP Unix Timestamp

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity66

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

Recently: every ~225 days

Total

9

Last Release

636d ago

Major Versions

1.0.0 → 2.0.02021-12-21

2.0.4 → 3.0.22022-09-21

3.0.2 → 4.0.02023-03-09

4.0.0 → 5.0.02024-08-14

PHP version history (2 changes)1.0.0PHP &gt;=7.4.0

3.0.2PHP &gt;=8.1.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/b51cb3992d341f8eebde2895a555ccf3d0a5f1d767dbe55d687d1cc312dd27f8?d=identicon)[sugatasei](/maintainers/sugatasei)

---

Top Contributors

[![sugatasei](https://avatars.githubusercontent.com/u/6987162?v=4)](https://github.com/sugatasei "sugatasei (9 commits)")

### Embed Badge

![Health badge](/badges/sugatasei-bredala-data/health.svg)

```
[![Health](https://phpackages.com/badges/sugatasei-bredala-data/health.svg)](https://phpackages.com/packages/sugatasei-bredala-data)
```

PHPackages © 2026

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