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 today

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 47% of packages

Maintenance46

Moderate activity, may be stable

Popularity2

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity46

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

421d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/136594948?v=4)[Rollins](/maintainers/adonko3xBitters)[@adonko3xBitters](https://github.com/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

[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.

1189.8k](/packages/rcsofttech-audit-trail-bundle)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M388](/packages/easycorp-easyadmin-bundle)[kimai/kimai

Kimai - Time Tracking

4.8k9.0k1](/packages/kimai-kimai)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1616.4k14](/packages/2lenet-crudit-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.

9410.8k](/packages/ahmed-bhs-doctrine-doctor)

PHPackages © 2026

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