PHPackages                             respect/structural - 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. respect/structural

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

respect/structural
==================

Fluent NoSQL Toolkit

12212[1 issues](https://github.com/Respect/Structural/issues)PHP

Since May 5Pushed 10y ago8 watchersCompare

[ Source](https://github.com/Respect/Structural)[ Packagist](https://packagist.org/packages/respect/structural)[ RSS](/packages/respect-structural/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Respect/Structural
==================

[](#respectstructural)

[![Latest Stable Version](https://camo.githubusercontent.com/e71386d3a713f9350c2f34a992353fed24ee4dbd4ab46bb8a75191e16b1f0cc0/68747470733a2f2f706f7365722e707567782e6f72672f726573706563742f7374727563747572616c2f762f737461626c65)](https://packagist.org/packages/respect/structural)[![Total Downloads](https://camo.githubusercontent.com/8c1296ee2b86fa0baa9a2cb28b2c276d637fba9ef690c7ee712edf3b5bddbaaf/68747470733a2f2f706f7365722e707567782e6f72672f726573706563742f7374727563747572616c2f646f776e6c6f616473)](https://packagist.org/packages/respect/structural)[![Latest Unstable Version](https://camo.githubusercontent.com/1cb8b3b7ccd38f88cf8e17dcefec923ef76a7564a27352998f05b276a50826a9/68747470733a2f2f706f7365722e707567782e6f72672f726573706563742f7374727563747572616c2f762f756e737461626c65)](https://packagist.org/packages/respect/structural)[![License](https://camo.githubusercontent.com/8b32beae4da4d701c74ce00765b07dc4714159c006a8564e2c670574bf708176/68747470733a2f2f706f7365722e707567782e6f72672f726573706563742f7374727563747572616c2f6c6963656e7365)](https://packagist.org/packages/respect/structural)

[![Build Status](https://camo.githubusercontent.com/12791cb5879e7aaaaa430b0ed9fd443b61d6751f50a0ae968d3c7af1fb2ab69d/68747470733a2f2f7472617669732d63692e6f72672f526573706563742f5374727563747572616c2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Respect/Structural)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/38911d99496e29cef543852ef1e0cf8ccaef702de71e4951114126926d0cfac4/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f526573706563742f5374727563747572616c2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Respect/Structural/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/572dfcd99048f7b5fe35981a86dfe94acd3c196190b8aee5f55c2939c7928cfd/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f526573706563742f5374727563747572616c2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Respect/Structural/?branch=master)[![StyleCI](https://camo.githubusercontent.com/2d525c6a35d0cdee382380d80c328f7ecc5df5052affe0ec4ed47eba35b769e1/68747470733a2f2f7374796c6563692e696f2f7265706f732f323735333333372f736869656c64)](https://styleci.io/repos/2753337)

### The Near-zero Part

[](#the-near-zero-part)

```
// bootstrap.php
require_once __DIR__ . '/vendor/autoload.php';

use Respect\Structural\Mapper;
use Respect\Structural\Driver\MongoDb\Style as MongoDbStyle;
use Respect\Structural\Driver\MongoDb\Driver as MongoDbDriver;

$driver = MongoDbDriver::factory('respect');

$mapper = new Mapper($driver);
$mapper->setStyle(new MongoDbStyle());
```

### Persisting

[](#persisting)

```
$author = new \stdClass();
$author->firstName = 'Antonio';
$mapper->authors->persist($author);
$mapper->flush();

echo "'{$author->firstName}' was created with id({$author->_id})".PHP_EOL;
```

### Updating

[](#updating)

```
$author->lastName = 'Spinelli';
$mapper->authors->persist($author);
$mapper->flush();

echo "last name was updated to '{$author->lastName}' from id({$author->_id})".PHP_EOL;
```

### Fetching

[](#fetching)

```
$authors = $mapper->authors->fetchAll();

echo "Fetching all authors:" . PHP_EOL;
foreach ($authors as $index => $author) {
    echo "{$index} {$author->firstName} {$author->lastName}" . PHP_EOL;
}
```

### Condition

[](#condition)

```
// find author by ID
$foundAuthor = $mapper->authors[(string)$author->_id]->fetch();
echo "find by id('{$author->_id}') {$foundAuthor->firstName} {$foundAuthor->lastName}".PHP_EOL;
```

### Removing

[](#removing)

```
$mapper->authors->remove($author);
$mapper->flush();

$author = $mapper->authors(['lastName' => 'Spinelli'])->fetch();
echo ($author ? "'Spinelli' was found" : "'Spinelli' removed.");
```

###  Health Score

24

—

LowBetter than 30% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 82.2% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/202642?v=4)[Alexandre Gomes Gaigalas](/maintainers/alganet)[@alganet](https://github.com/alganet)

![](https://avatars.githubusercontent.com/u/154023?v=4)[Henrique Moody](/maintainers/henriquemoody)[@henriquemoody](https://github.com/henriquemoody)

![](https://www.gravatar.com/avatar/4343df4adee634d5953da73aa5b61e4af61dbd37bf4e97449240c8a32c142dc5?d=identicon)[augustohp](/maintainers/augustohp)

![](https://avatars.githubusercontent.com/u/966337?v=4)[Antonio Spinelli](/maintainers/tonicospinelli)[@tonicospinelli](https://github.com/tonicospinelli)

---

Top Contributors

[![tonicospinelli](https://avatars.githubusercontent.com/u/966337?v=4)](https://github.com/tonicospinelli "tonicospinelli (37 commits)")[![alganet](https://avatars.githubusercontent.com/u/202642?v=4)](https://github.com/alganet "alganet (4 commits)")[![faabiosr](https://avatars.githubusercontent.com/u/522883?v=4)](https://github.com/faabiosr "faabiosr (2 commits)")[![nickl-](https://avatars.githubusercontent.com/u/1404606?v=4)](https://github.com/nickl- "nickl- (2 commits)")

### Embed Badge

![Health badge](/badges/respect-structural/health.svg)

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

###  Alternatives

[pdmfc/nova-info-card

A Laravel Nova info card.

14103.9k2](/packages/pdmfc-nova-info-card)[mindkomm/types

Custom Post Type and Taxonomy helper classes for WordPress

154.3k1](/packages/mindkomm-types)

PHPackages © 2026

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