PHPackages                             dmr/dmr - 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. [Database &amp; ORM](/categories/database)
4. /
5. dmr/dmr

ArchivedLibrary[Database &amp; ORM](/categories/database)

dmr/dmr
=======

PHP 5.3+ library that provides a simple and flexible way to load custom mapping data for Doctrine 2.3+ projects

6108[1 issues](https://github.com/marcospassos/DMR/issues)PHP

Since Oct 7Pushed 12y agoCompare

[ Source](https://github.com/marcospassos/DMR)[ Packagist](https://packagist.org/packages/dmr/dmr)[ RSS](/packages/dmr-dmr/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Doctrine Mapping Reader
=======================

[](#doctrine-mapping-reader)

PHP 5.3+ library that provides a simple and flexible way to load custom mapping data for [Doctrine 2.3+](https://github.com/doctrine/) projects.

It supports **Yaml**, **Xml** and **Annotation** drivers which will be chosen depending on currently used mapping driver for your domain objects.

Credits to [DoctrineExtensions](https://github.com/l3pp4rd/DoctrineExtensions), which big part of the code was inspired or extracted from.

[![Build Status](https://camo.githubusercontent.com/db3c16f2b1fd091cb52155fef8bc8d10f7a7605621676a2ef325723598166251/68747470733a2f2f7472617669732d63692e6f72672f6d6172636f73706173736f732f444d522e706e67)](https://travis-ci.org/marcospassos/DMR)

What is this for?
-----------------

[](#what-is-this-for)

This library is useful if you need read some data from Doctrine mapping files.

Imagine you have developed a DataGrid library and you need to know which properties should be exposed. You can easily create your own mapping in order to mark some properties for hidding and read before being rendered. This is a perfect case where this library can help you.

How it works?
-------------

[](#how-it-works)

Doctrine provides several different ways for specifying mapping metadata:

- Docblock Annotations
- XML
- YAML

For each mapping metadata you want to support, you are going to create a driver for loading the relevant metadata that you need. Fortunately, this library does almost all the job for you and in the most of cases you need only read the data and store in the array that will be returned at the end.

Reading Doctrine's metadata is simple as:

```
