PHPackages                             mnapoli/metamodel - 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. mnapoli/metamodel

AbandonedArchivedLibrary

mnapoli/metamodel
=================

0.1.0(12y ago)75811PHP

Since Jul 15Pushed 12y ago1 watchersCompare

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

READMEChangelogDependencies (1)Versions (2)Used By (1)

MetaModel
=========

[](#metamodel)

Meta is a **DSL** that enables to represent, traverse and operate on PHP objects.

[![Build Status](https://camo.githubusercontent.com/6d35349ce88fcb425a7aa3eeb694a567949e14a74f86953d9251e526a1fb8a4b/68747470733a2f2f7472617669732d63692e6f72672f6d6e61706f6c692f4d6574614d6f64656c2e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/mnapoli/MetaModel) [![Coverage Status](https://camo.githubusercontent.com/be9aec65ac81bb1de79fed0bcb7e53a3c59ed3f33015e8e5ebc202bd5cfefcfb/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6d6e61706f6c692f4d6574614d6f64656c2f62616467652e706e673f6272616e63683d6d6173746572)](https://coveralls.io/r/mnapoli/MetaModel?branch=master)

Syntax
------

[](#syntax)

- Get a specific object by its ID:

```
Article(1)
```

MetaModel integrates with **Doctrine**, but can be connected to anything.

- Get all objects of a type

```
Article(*)
```

- Object graph traversing (get all the articles of a category):

```
Category(1).articles
```

- Call methods:

```
// Will call generateExtract() on all articles
Article(*).generateExtract()
```

- Field filtering (not implemented yet):

```
Article[author="bob"]
```

Operators:

```
UserGroup[ users.contains(User(1)) ]
UserGroup[ users.count() > 0 ]
```

- Service:

```
CacheService.flush()
```

MetaModel integrates with containers, registries, anything…

Integration
-----------

[](#integration)

MetaModel finds objects in data sources. You can add any data source by implementing the simple interfaces: `ObjectManager` or `Container`.

Some libraries are already supported natively:

- **Doctrine**'s Entity Manager: `MetaModel\Bridge\Doctrine\EntityManagerBridge`

    ```
    $metaModel = new MetaModel();
    $metaModel->addObjectManager(new EntityManagerBridge($entityManager));
    ```
- [**PHP-DI**](https://github.com/mnapoli/PHP-DI) container: `MetaModel\Bridge\PHPDI\PHPDIBridge`

    ```
    $metaModel = new MetaModel();
    $metaModel->addContainer(new PHPDIBridge($container));
    ```

Add your own by submitting a pull request.

Usages
------

[](#usages)

Those are both ideas and work in progress.

- **MetaConsole**: [Simplified Model/DB manipulation from console](https://github.com/mnapoli/MetaConsole)

Instead of using phpMyAdmin, or building an admin interface, you can manipulate the DB with high level object queries.

- Advanced replacement for [PropertyAccess](https://github.com/symfony/PropertyAccess), e.g. to build forms, templates (Twig?)
- Simplified object queries (from database)
- Paths for anything meta on your model: logs, AOP, ACL (e.g. "`User(1)` can edit `Category(12).articles`")

Projects using MetaModel:

- [MetaConsole](https://github.com/mnapoli/MetaConsole)
- [Xport](https://github.com/myclabs/Xport)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

4680d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/329a6111724074f5388e95dd41a03ccf3c43f4bfe1ecf27c94c9efc6f7823228?d=identicon)[mnapoli](/maintainers/mnapoli)

---

Top Contributors

[![mnapoli](https://avatars.githubusercontent.com/u/720328?v=4)](https://github.com/mnapoli "mnapoli (40 commits)")

### Embed Badge

![Health badge](/badges/mnapoli-metamodel/health.svg)

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

###  Alternatives

[sonata-project/entity-audit-bundle

Audit for Doctrine Entities

644989.8k1](/packages/sonata-project-entity-audit-bundle)[neos/flow

Flow Application Framework

862.0M449](/packages/neos-flow)[api-platform/doctrine-orm

Doctrine ORM bridge

243.1M39](/packages/api-platform-doctrine-orm)[neos/flow-development-collection

Flow packages in a joined repository for pull requests.

144179.3k3](/packages/neos-flow-development-collection)[pixelfederation/doctrine-resettable-em-bundle

Symfony bundle for decorating default entity managers using a resettable decorator.

20113.5k](/packages/pixelfederation-doctrine-resettable-em-bundle)[leapt/core-bundle

Symfony LeaptCoreBundle

2529.1k4](/packages/leapt-core-bundle)

PHPackages © 2026

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