PHPackages                             managlea/resource-mapper - 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. managlea/resource-mapper

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

managlea/resource-mapper
========================

0202PHP

Since Mar 28Pushed 10y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

ResourceMapper
==============

[](#resourcemapper)

ResourceMapper maps resources with correct entity class and entity manager

[![Build Status](https://camo.githubusercontent.com/d35f1fed2746f04767c662da45da0b28040f0b49aa97f90eda9c40bb834b4f09/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d616e61676c65612f5265736f757263654d61707065722f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/managlea/ResourceMapper/build-status/master) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/b451cb60365cc291d1685507b09a928e8b712c4cd8a69cd08ad70972e4ed9052/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d616e61676c65612f5265736f757263654d61707065722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/managlea/ResourceMapper/?branch=master) [![Code Coverage](https://camo.githubusercontent.com/03f0dca94d08982068661553f569a0d6e11fe75750ecf31c6833686c36824d67/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d616e61676c65612f5265736f757263654d61707065722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/managlea/ResourceMapper/?branch=master)
[![Code Climate](https://camo.githubusercontent.com/0dd1cfbe213c1bc8d2e7c6130a79e40b05fef1387afe9da7fbb2388729b3ccdc/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6d616e61676c65612f5265736f757263654d61707065722f6261646765732f6770612e737667)](https://codeclimate.com/github/managlea/ResourceMapper) [![Test Coverage](https://camo.githubusercontent.com/3bca0cd46b85d5f906931686a7f51b4b865938cf709e87fa4c901f30fde9e2d0/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6d616e61676c65612f5265736f757263654d61707065722f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/managlea/ResourceMapper/coverage)
[![SensioLabsInsight](https://camo.githubusercontent.com/41b8586fbcbf8e149edea3580f278348ae0b47e43b328a3784f8c7a91c9f18fb/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f32323334306262302d343730632d343737392d623463322d3339656363643766653437312f6d696e692e706e67)](https://insight.sensiolabs.com/projects/22340bb0-470c-4779-b4c2-39eccd7fe471)
[![Codacy Badge](https://camo.githubusercontent.com/3a0a178093fbdaebb4d8ca6dc2a494b73b2db9b4f6768cd444b1d3aa91c552b5/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f67726164652f3562386239656132323763353433366638326431666633646133363065343061)](https://www.codacy.com/app/Managlea/ResourceMapper)
[![Build Status](https://camo.githubusercontent.com/c50f96b1731168eaffbc4948427e2695da2f4c841b73a54ec493ced969cd096a/68747470733a2f2f7472617669732d63692e6f72672f6d616e61676c65612f5265736f757263654d61707065722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/managlea/ResourceMapper) [![Circle CI](https://camo.githubusercontent.com/4361f52d117b75c27bd2e869dec25727c9be2f4eab5262854b2589b38a8852db/68747470733a2f2f636972636c6563692e636f6d2f67682f6d616e61676c65612f5265736f757263654d61707065722f747265652f6d61737465722e7376673f7374796c653d737667)](https://circleci.com/gh/managlea/ResourceMapper/tree/master)
[![PHP Versions tested](https://camo.githubusercontent.com/53ee471dabc156191daa0798c87cb4ee658f7d905cbbd4998f5e26ad0b8b6ff9/687474703a2f2f7068702d6579652e636f6d2f62616467652f6d616e61676c65612f7265736f757263652d6d61707065722f7465737465642e7376673f6272616e63683d6d6173746572)](https://camo.githubusercontent.com/53ee471dabc156191daa0798c87cb4ee658f7d905cbbd4998f5e26ad0b8b6ff9/687474703a2f2f7068702d6579652e636f6d2f62616467652f6d616e61676c65612f7265736f757263652d6d61707065722f7465737465642e7376673f6272616e63683d6d6173746572)

Basic usage
-----------

[](#basic-usage)

### Configuration file

[](#configuration-file)

```
# resource_mapping.yml

default_entity_manager: Managlea\Component\DoctrineEntityManager
mapping:
  foo:
    object_name: Entities\Foo
  bar:
    entity_manager: BarEntityManager
    object_name: Entities\Bar
```

### Code execution

[](#code-execution)

```
// Create new ResourceMapper
$resourceMapper = new ResourceMapper;

// Get entityManagerName (string) for resource
$entityManagerName = $resourceMapper->getEntityManagerName('foo');

// Create new EntityManager (instanceof Managlea\Component\EntityManagerInterface) by name
$entityManager = new EntityManagerFactory::create($entityManagerName);

// Get objectName (string) for resource
$objectName = $resourceMapper->getObjectName('foo');

// Use objectName in entity manager to retrieve entity (object)
$entity = $entityManager->get($objectName, 1);
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.4% 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://www.gravatar.com/avatar/7c2a60196ecf5aa21a862db9d35161146ee824366621439380ef212a774ffe75?d=identicon)[managlea-adm](/maintainers/managlea-adm)

---

Top Contributors

[![kaurikk](https://avatars.githubusercontent.com/u/4194333?v=4)](https://github.com/kaurikk "kaurikk (37 commits)")[![managlea-adm](https://avatars.githubusercontent.com/u/11567820?v=4)](https://github.com/managlea-adm "managlea-adm (1 commits)")

### Embed Badge

![Health badge](/badges/managlea-resource-mapper/health.svg)

```
[![Health](https://phpackages.com/badges/managlea-resource-mapper/health.svg)](https://phpackages.com/packages/managlea-resource-mapper)
```

PHPackages © 2026

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