PHPackages                             astina/labels-bundle - 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. [Search &amp; Filtering](/categories/search)
4. /
5. astina/labels-bundle

AbandonedArchivedSymfony-bundle[Search &amp; Filtering](/categories/search)

astina/labels-bundle
====================

Symfony bundle that offers categorized labels for Doctrine entities to be used for filtered search.

0.4.0(10y ago)01.0kMITPHP

Since May 6Pushed 10y ago16 watchersCompare

[ Source](https://github.com/astina/AstinaLabelsBundle)[ Packagist](https://packagist.org/packages/astina/labels-bundle)[ Docs](http://astina.ch)[ RSS](/packages/astina-labels-bundle/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (2)Versions (8)Used By (0)

Astina Labels Bundle
====================

[](#astina-labels-bundle)

Add categorized translatable labels to Doctrine entities and use them for filtered search.

### Configuration

[](#configuration)

Add the following to your AppKernel.php file

```
class AppKernel extends Kernel {
    public function registerBundles() {
        $bundles = array(
            ...
            new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
            new Astina\Bundle\LabelsBundle\AstinaLabelsBundle(),
            ...
        );
    }
}
```

Add the following to your config.yml

```
stof_doctrine_extensions:
    default_locale: de
    translation_fallback: true
    orm:
        default:
            translatable: true

doctrine:
    orm:
        mappings:
            gedmo_translatable:
                type: annotation
                prefix: Gedmo\Translatable\Entity
                dir: "%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Translatable/Entity"
                is_bundle: false
```

### Usage

[](#usage)

Add `labels` property to your entity:

```
class Foo
{
    // ...

    /**
     * @ORM\ManyToMany(targetEntity="Astina\Bundle\LabelsBundle\Entity\Label")
     */
    private $labels;
}
```

Use it in a formType like this:

```
    $builder
        ->add('labels', 'astina_labels', array(
            'categories' => array('category1', 'category2'...),
            'label' => 'Labels',
            'required' => false,
        ))
    ;
```

Each label has to belong to a category if you want to see them in a formType so configure them with fixtures.

```
    public function load(ObjectManager $manager)
    {
        $labelCategory = new LabelCategory();
        $labelCategory->setName('category1');
        $manager->persist($labelCategory);

        foreach ($labelsArray as $labelName) {
            $label = new Label();
            $label->setName($labelName);
            $label->setCategory($labelCategory);
            $manager->persist($label);
        }
        $manager->flush();
    }
```

### Search

[](#search)

Configure a filter search service:

```
# .../config/services.yml
services:
    app.filter_search.foo:
        class: Astina\Bundle\LabelsBundle\Search\LabelSearch
        #class: Astina\Bundle\LabelsBundle\Search\TranslatedLabelSearch
        arguments:
            - @astina_labels.repository.label
            - @app.repository.foo

    app.repository.foo:
        class: Doctrine\ORM\EntityRepository
        factory_service: doctrine
        factory_method: getRepository
        arguments:
            - AppMyBundle:Foo
```

Use the service to find entities for given labels:

```
$search = $container->get('app.filter_search.foo');
$results = $search->search(new SearchQuery($labels));
```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 77.8% 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

Every ~121 days

Recently: every ~158 days

Total

7

Last Release

3658d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3040e7efc5d9bf912864758bec0e4e70d5acdc468d5239e960d95431d5c65b74?d=identicon)[pkraeutli](/maintainers/pkraeutli)

---

Top Contributors

[![pkraeutli](https://avatars.githubusercontent.com/u/886082?v=4)](https://github.com/pkraeutli "pkraeutli (7 commits)")[![virtualize](https://avatars.githubusercontent.com/u/220102?v=4)](https://github.com/virtualize "virtualize (2 commits)")

---

Tags

searchfilterlabels

### Embed Badge

![Health badge](/badges/astina-labels-bundle/health.svg)

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

###  Alternatives

[friendsofcake/search

CakePHP Search plugin using PRG pattern

1742.0M37](/packages/friendsofcake-search)[outl1ne/nova-input-filter

An input filter for Laravel Nova

24822.7k](/packages/outl1ne-nova-input-filter)[optimistdigital/nova-input-filter

An input filter for Laravel Nova

24550.6k2](/packages/optimistdigital-nova-input-filter)[skie/cakephp-search

CakePHP Plum Search plugin

19186.5k2](/packages/skie-cakephp-search)[rollerworks/search-bundle

RollerworksSearch Bundle

1015.8k1](/packages/rollerworks-search-bundle)

PHPackages © 2026

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