PHPackages                             blesta/items - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. blesta/items

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

blesta/items
============

A library for items with arbitrary data.

1.1.1(1y ago)2826↓50%MITPHPPHP &gt;=5.4

Since May 25Pushed 1y ago5 watchersCompare

[ Source](https://github.com/blesta/items)[ Packagist](https://packagist.org/packages/blesta/items)[ RSS](/packages/blesta-items/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (8)Used By (0)

blesta/items
============

[](#blestaitems)

A library for creating a collection of items that store arbitrary data.

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

[](#installation)

Install via composer:

```
composer require blesta/items:~1.0
```

Basic Usage
-----------

[](#basic-usage)

### Item

[](#item)

Item stores generic data, typically user-defined arrays or object data.

```
$item = new Item();
```

Set fields onto the item:

```
$fields = [
    'key' => 'item1',
    'value' => 'Item'
];
$item->setFields($fields);
$item->setField('custom', 'ABC123');
$item->removeField('value');
print_r($item->getFields());
```

Output is a standard class object of the fields:

```
stdClass Object (
    [key] => item1
    [custom] => ABC123
)

```

### ItemMap

[](#itemmap)

ItemMap combines the values from one Item with the keys of another Item. The result is a new Item consisting of only the mapped keys that have item values.

```
// Create the item
$fields = [
    'domain' => 'domain.com',
    'amount' => 100.0000,
    'override_amount' => 150.0000,
    'custom' => 'ABC123'
];
$item = new Item();
$item->setFields($fields);

// Create an item to use for field mapping
$mapFields = [
    'value' => 'domain',
    'price' => ['override_amount', 'amount']
    'type' => 'generic'
];
$mapItem = new Item();
$mapItem->setFields($mapFields);

$map = new ItemMap();
$newItem = $map->combine($item, $mapItem);
print_r($newItem->getFields());
```

The fields set on the new item are only those keys from $mapItem that exist in $item after performing the mapping:

```
stdClass Object (
    [value] => domain.com
    [price] => 150.0000
)

```

### ItemCollection

[](#itemcollection)

```
$collection = new ItemCollection();

$item1 = new Item();
$item2 = new Item();
$collection->append($item1)->append($item2);
$total = $collection->count(); // 2

$collection->remove($item1);
$total = $collection->count(); // 1

foreach ($collection as $item) {
    print_r($item->getFields()); // stdClass object of fields
}

```

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 60% 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 ~986 days

Total

4

Last Release

686d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7f87ae869d67f48673504d6cba1adcb8945a3ba8280798917e18b7c744009fc2?d=identicon)[clphillips](/maintainers/clphillips)

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

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

---

Top Contributors

[![tysonphillips](https://avatars.githubusercontent.com/u/8607630?v=4)](https://github.com/tysonphillips "tysonphillips (12 commits)")[![abdyfranco](https://avatars.githubusercontent.com/u/23648083?v=4)](https://github.com/abdyfranco "abdyfranco (5 commits)")[![JReissmueller](https://avatars.githubusercontent.com/u/18198499?v=4)](https://github.com/JReissmueller "JReissmueller (2 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/blesta-items/health.svg)

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

###  Alternatives

[grrr-amsterdam/garp-functional

Utility library embracing functional programming paradigms.

32116.1k5](/packages/grrr-amsterdam-garp-functional)

PHPackages © 2026

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