PHPackages                             mte/doctrineviewsbundle - 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. mte/doctrineviewsbundle

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

mte/doctrineviewsbundle
=======================

Generate MySQL views with Doctrine

011PHP

Since Feb 4Pushed 8y ago1 watchersCompare

[ Source](https://github.com/mrk-te/DoctrineViewsBundle)[ Packagist](https://packagist.org/packages/mte/doctrineviewsbundle)[ RSS](/packages/mte-doctrineviewsbundle/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

MteDoctrineViewsBundle
======================

[](#mtedoctrineviewsbundle)

Converts a Doctrine\\ORM\\Query in a Doctrine\\DBAL\\Schema\\View.

Provides a manager class to convert, create, and the views.

Configuration
-------------

[](#configuration)

```
mte_doctrine_views:
    dbal:

        # Example:
        default:             database_connection

        # Prototype
        name:                 ~

```

Generates a service "mte.doctrine\_views.manager.default" associated to the DBAL service "database\_connection"

```
Information for Service "mte.doctrine_views.manager.default"
============================================================

 ---------------- ---------------------------------------------------
  Option           Value
 ---------------- ---------------------------------------------------
  Service ID       mte.doctrine_views.manager.default
  Class            Mte\DoctrineViewsBundle\Doctrine\View\ViewManager
  Tags             -
  Public           yes
  Synthetic        no
  Lazy             no
  Shared           yes
  Abstract         no
  Autowired        no
  Autoconfigured   no
 ---------------- ---------------------------------------------------

```

Usage
-----

[](#usage)

Get the Doctrine Query Builder query :

```
class UserRepository extends ServiceEntityRepository
{
    public function createUserViewQuery()
    {
        $qb     = $this->createQueryBuilder('u');

        return $qb->select('u.id')
            ->addSelect('CONCAT(u.username, \'@\', d.name) AS user')
            ->addSelect('u.password')
            ->join('u.domain', 'd')
            ->where('u.enabled = true')
            ->andWhere('d.enabled = true')
            ->getQuery();
    }
}
```

Use the manager to handle your view

```
/**
 * @var App\Repository\UserRepository $userRepository
 */
$query	= $userRepository->createUserViewQuery();

/**
 * Converts the Doctrine\ORM\Query $query in Doctrine\DBAL\Schema\View
 * @var Mte\DoctrineViewsBundle\Doctrine\View\ViewManager $viewManager
 * @see #Configuration
 */
$view 	= $viewManager->getViewFromQuery('my_user_view', $query);

/**
 * Creates the given view
 */
$viewManager->createView($view)

/**
 * Drops the given View if exists
 * Creates the given view
 */
$viewManager->dropAndCreateView($view)

/**
 * Converts the Doctrine\ORM\Query $query in Doctrine\DBAL\Schema\View
 * Creates the given view
 */
$viewManager->createViewFromQuery('my_user_view', $query)

/**
 * Converts the Doctrine\ORM\Query $query in Doctrine\DBAL\Schema\View
 * Drops the given View if exists
 * Creates the given view
 */
$viewManager->dropAndCreateViewFromQuery(string $name, Query $query)
```

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

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/3161a80da941c527f31c9ecb37900800a5a4255cff3340e946ba0de770edab3f?d=identicon)[mrk-te](/maintainers/mrk-te)

### Embed Badge

![Health badge](/badges/mte-doctrineviewsbundle/health.svg)

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

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M546](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

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