PHPackages                             ostmanytoone/ostmanytoone - 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. [Framework](/categories/framework)
4. /
5. ostmanytoone/ostmanytoone

ActiveLibrary[Framework](/categories/framework)

ostmanytoone/ostmanytoone
=========================

Easy for use ManyToOne bundle

216PHP

Since Aug 8Pushed 13y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

OstManyToOneBundle - Many to One relation form widget
=====================================================

[](#ostmanytoonebundle---many-to-one-relation-form-widget)

Installation
------------

[](#installation)

- Add lines in deps file:

```
	[PagerBundle]
	    git=https://github.com/makerlabs/PagerBundle.git
	    target=/bundles/MakerLabs/PagerBundle

	[OstManyToOneBundle]
	    git=https://ruFog@github.com/ruFog/OstManyToOneBundle.git
	    target=/bundles/Ost/ManyToOneBundle

```

- Add object init in AppKernel.php:

```
	new \Ost\ManyToOneBundle\OstManyToOneBundle(),

```

- Add autoload.php:

```
	'Ost' => __DIR__.'/../vendor/bundles',

```

- And run:

```
	php bin/vendors install

```

Usage
-----

[](#usage)

In buildForm function:

```
->add('requestedBy', 'object_many_to_one_selector', array(
	'form_class' => addslashes(__CLASS__),
        'label' => 'Requested By',
        'entity' => 'OstUserBundle:User',
        'list_template' => 'OstUserBundle:User:many_to_one_list.html.twig',
        'query_builder' => function(EntityRepository $er) {
        	return $er->createQueryBuilder('u')
                    ->where('u.roles not like :role_manager')
                    ->andWhere('u.roles not like :role_admin')
                    ->setParameter('role_manager', '%MANAGER%')
                    ->setParameter('role_admin', '%SUPER%')
                    ->orderBy('u.username', 'ASC')
                ;
        },
        'query_builder_search' => function(QueryBuilder $qb, $query){
                return $qb->andWhere('u.username like :query')
                    ->setParameter('query', '%'.$query.'%')
                ;
        },
        'items_per_page' => 5
))
```

many\_to\_one\_list.html.twig example:

```

    {% for entity in entities %}

        {{ entity.id }}
        {{ entity.username }}
        {{ entity.getRolesString() }}

    {% endfor %}

```

`OstUserBundle:User` (or any other) entity must contain id unique primary key and function `__toString()`.

Default value of `items_per_page` is 10.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/8c85aa9a572999013132c946b89088cc645fdcb4cd0ef5aea66627a8acc39d24?d=identicon)[ruFog](/maintainers/ruFog)

---

Top Contributors

[![ostretsov](https://avatars.githubusercontent.com/u/229966?v=4)](https://github.com/ostretsov "ostretsov (8 commits)")

### Embed Badge

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

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

###  Alternatives

[laravel/telescope

An elegant debug assistant for the Laravel framework.

5.2k67.8M190](/packages/laravel-telescope)[spiral/roadrunner

RoadRunner: High-performance PHP application server and process manager written in Go and powered with plugins

8.4k12.2M84](/packages/spiral-roadrunner)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M256](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

708181.8M591](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)

PHPackages © 2026

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