PHPackages                             webfactory/visibility-filter-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. webfactory/visibility-filter-bundle

AbandonedArchivedLibrary

webfactory/visibility-filter-bundle
===================================

Symfony Bundle that filters out invisible Doctrine entities in a centralised way

2.0.0(11mo ago)01.8k[8 issues](https://github.com/webfactory/webfactory-visibility-filter-bundle/issues)[2 PRs](https://github.com/webfactory/webfactory-visibility-filter-bundle/pulls)MITPHPPHP ^8.1CI passing

Since Apr 18Pushed 11mo ago2 watchersCompare

[ Source](https://github.com/webfactory/webfactory-visibility-filter-bundle)[ Packagist](https://packagist.org/packages/webfactory/visibility-filter-bundle)[ RSS](/packages/webfactory-visibility-filter-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (11)Versions (23)Used By (0)

VisibilityFilterBundle – A centralised approach to visibility of Doctrine Entities
==================================================================================

[](#visibilityfilterbundle--a-centralised-approach-to-visibility-of-doctrine-entities)

This bundle provides a Doctrine Filter which handles visibility filtering for Entities transparently for a whole application, removing the need to repeatedly phrase the filtering in every repository method of an Entity. Most notably, the filtering also applies to Doctrine queries that bypass the repository, like relationships declared in the entity mapping.

Getting started
---------------

[](#getting-started)

First, you need to declare this bundle as a composer dependency.

```
composer require webfactory/visibility-filter-bundle
```

Next, the bundle needs to be registered to Symfony. Depending on your Symfony version, this might look like that:

```
# src/bundles.php

return [
    # ...
        Webfactory\VisibilityFilterBundle\VisibilityFilterBundle::class => ['all' => true],
    # ...
];
```

The filter class needs to be registered manually.

```
# src/config.yml
doctrine:
    orm:
        filters:
            visibility: Webfactory\VisibilityFilterBundle\Filter\VisibilityColumnConsideringSQLFilter
```

Important: The YAML key of the filter needs to `visibility`, otherwise the filter won't be activated on requests.

Configuring the visibility column
---------------------------------

[](#configuring-the-visibility-column)

This bundle assumes that the visibility determination is going to be based on a specific field in the Entity containing visibility information; e.g. functioning as a "visibility switch" containing "yes" or "no" or containing a visibility grade on a scale, based on which the visibility of the object will be determined.

**Currently, only entities that have a visibility column configured will be filtered at all.**

All you need to configure on your entity is *which* of its fields will be the one with the visibility information. You can do that by Adding the `VisibilityColumn` attribute to that field.

```
use Doctrine\ORM\Mapping as ORM;
use Webfactory\VisibilityFilterBundle\Attribute\VisibilityColumn;

 #[ORM\Entity()]
class EntityWithVisibilityColumn
{
    // ...
     #[ORM\Column(type: "string")]
     #[VisibilityColumn]
    private string $visibilityColumn;
    // ...
}
```

Please note that configuring more than one field as visibility column will throw an exception.

Replacing the filter strategy
-----------------------------

[](#replacing-the-filter-strategy)

By default, the library makes you application only query entities from the database that have the string `y` in their visibility column. You can change this behaviour by overwriting the service `Webfactory\VisibilityFilterBundle\Filter\FilterStrategy` with your own implementation.

Your implementation needs to implement the `FilterStrategy` interface. If you only want to change the `y` string to something different, you can use the `Webfactory\VisibilityFilterBundle\Filter\Strategy\ValueInField` implementation and provide it with a different `visibleValue` in its constructor.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance52

Moderate activity, may be stable

Popularity15

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 77.2% 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 ~217 days

Total

8

Last Release

336d ago

Major Versions

1.5.0 → 2.0.02025-06-16

PHP version history (3 changes)1.0PHP ^7.2

1.3.0PHP ^7.2|^8.1

1.5.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/d4ed0a0f5a1c56f7df31bb8c854a2ad99d24281dc8df4b4d3dd986a9e84b7a24?d=identicon)[webfactory](/maintainers/webfactory)

---

Top Contributors

[![janopae](https://avatars.githubusercontent.com/u/8160319?v=4)](https://github.com/janopae "janopae (78 commits)")[![mpdude](https://avatars.githubusercontent.com/u/1202333?v=4)](https://github.com/mpdude "mpdude (12 commits)")[![relthyg](https://avatars.githubusercontent.com/u/8628559?v=4)](https://github.com/relthyg "relthyg (9 commits)")[![MalteWunsch](https://avatars.githubusercontent.com/u/2504942?v=4)](https://github.com/MalteWunsch "MalteWunsch (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/webfactory-visibility-filter-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/webfactory-visibility-filter-bundle/health.svg)](https://phpackages.com/packages/webfactory-visibility-filter-bundle)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k16.7M310](/packages/easycorp-easyadmin-bundle)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[codefog/contao-haste

haste extension for Contao Open Source CMS

42650.8k139](/packages/codefog-contao-haste)

PHPackages © 2026

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