PHPackages                             adonko3xbitters/symfony-archivable - 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. adonko3xbitters/symfony-archivable

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

adonko3xbitters/symfony-archivable
==================================

A reusable Symfony trait for archiving entities using Doctrine filters.

1.0.0(1y ago)10MITPHPPHP &gt;=8.1

Since May 8Pushed 1y ago1 watchersCompare

[ Source](https://github.com/adonko3xBitters/symfony-archivable)[ Packagist](https://packagist.org/packages/adonko3xbitters/symfony-archivable)[ RSS](/packages/adonko3xbitters-symfony-archivable/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

Symfony Archivable
==================

[](#symfony-archivable)

A lightweight Symfony package that provides a reusable `Archivable` trait and a Doctrine filter to automatically exclude archived entities from queries.

📦 Installation
--------------

[](#-installation)

Install the package via Composer:

```
composer require adonko3xBitters/symfony-archivable
```

🚀 Features
----------

[](#-features)

- Easily mark entities as archived using a single trait.
- Automatically exclude archived records from Doctrine queries.
- Enable or disable the filter at runtime.

🧑‍💻 Usage/Examples
------------------

[](#‍-usageexamples)

#### 1. Use the `Archivable` trait in your entities

[](#1-use-the-archivable-trait-in-your-entities)

```
use adonko3xBitters\SymfonyArchivable\Archivable;

#[ORM\Entity]
class Article
{
    use Archivable;

    // other properties...
}
```

#### 2. Register the Doctrine filter in your configuration

[](#2-register-the-doctrine-filter-in-your-configuration)

In `config/packages/doctrine.yaml`:

```
doctrine:
    orm:
        filters:
            archived:
                class: adonko3xBitters\SymfonyArchivable\Doctrine\ArchivedFilter
                enabled: true
```

#### 3. Archive an entity

[](#3-archive-an-entity)

To archive an entity, simply set the `archivedAt` property:

```
$article->setArchivedAt(new \DateTimeImmutable());
$entityManager->flush();
```

#### 4. Doctrine queries will exclude archived entities by default

[](#4-doctrine-queries-will-exclude-archived-entities-by-default)

The filter automatically applies `archived_at IS NULL` to all entities using the Archivable trait.

#### 5. Disable the filter manually (when needed)

[](#5-disable-the-filter-manually-when-needed)

If you want to include archived entities in a specific query:

```
$entityManager = $this->getDoctrine()->getManager();
$entityManager->getFilters()->disable('archived');

// perform query including archived entities...

$entityManager->getFilters()->enable('archived');
```

📂 Directory Structure
---------------------

[](#-directory-structure)

```
src/
├── Archivable.php
└── Doctrine/
    └── ArchivedFilter.php
```

📄 License
---------

[](#-license)

This package is open-sourced software licensed under the [MIT](https://choosealicense.com/licenses/mit/) license.

---

👤 Authors
---------

[](#-authors)

- [@adonko3xBitters](https://https://github.com/adonko3xBitters)

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance49

Moderate activity, may be stable

Popularity2

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity45

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

369d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/416653d8153c77855b9d44cc9964c6880a5e1891f95dbc0ed223b31c6ddc0133?d=identicon)[adonko3xBitters](/maintainers/adonko3xBitters)

### Embed Badge

![Health badge](/badges/adonko3xbitters-symfony-archivable/health.svg)

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

###  Alternatives

[hautelook/alice-bundle

Symfony bundle to manage fixtures with Alice and Faker.

19519.4M34](/packages/hautelook-alice-bundle)[kimai/kimai

Kimai - Time Tracking

4.6k7.4k1](/packages/kimai-kimai)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1022.4k](/packages/rcsofttech-audit-trail-bundle)[ahmed-bhs/doctrine-doctor

Runtime analysis tool for Doctrine ORM integrated into Symfony Web Profiler. Unlike static linters, it analyzes actual query execution at runtime to detect performance bottlenecks, security vulnerabilities, and best practice violations during development with real execution context and data.

813.1k](/packages/ahmed-bhs-doctrine-doctor)[heymoon/doctrine-psql-enum

Store PHP native enums as PostgeSQL custom enum types

254.9k](/packages/heymoon-doctrine-psql-enum)

PHPackages © 2026

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