PHPackages                             schvoy/base-entity-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. [Database &amp; ORM](/categories/database)
4. /
5. schvoy/base-entity-bundle

ActiveSymfony-bundle[Database &amp; ORM](/categories/database)

schvoy/base-entity-bundle
=========================

A bundle which provides base doctrine entities and behaviors for Symfony projects.

v1.1.1(3mo ago)82523MITPHPPHP &gt;=8.4CI failing

Since Dec 1Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/schvoy/base-entity-bundle)[ Packagist](https://packagist.org/packages/schvoy/base-entity-bundle)[ RSS](/packages/schvoy-base-entity-bundle/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (10)Dependencies (18)Versions (14)Used By (3)

Base entity bundle
==================

[](#base-entity-bundle)

A bundle which provides base doctrine entities and behaviors for Symfony projects.

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

[](#installation)

```
composer require schvoy/base-entity-bundle
```

Usage
-----

[](#usage)

### Use base entities as Mapped Superclass

[](#use-base-entities-as-mapped-superclass)

```
class  extends UuidBasedEntity
```

```
class  extends UlidBasedEntity
```

```
class  extends IdBasedEntity
```

**All of them provide commonly used entity functionalities:**

- `$id` property with getId() / setId() method - the value based on the class name can be integer, Uuid or Ulid
- Timestampable behavior
    - `$createdAt`
    - `$updatedAt`
- SoftDeleteable behavior
    - `$deletedAt`
- Blameable behavior
    - `$createdBy`
    - `$updatedBy`
    - `$deletedBy`

### Only traits? Yes

[](#only-traits-yes)

If you don't want to use the Mapped Superclasses? Than you can use only the traits. In this case you can extend your entity classes with the traits what you want to use.

```
# Id entity traits
use IdBasedEntityTrait;
use UuidBasedEntityTrait;
use UliddBasedEntityTrait;

# Doctrine Behavior traits
use BlameableTrait;
use SoftDeleteableTrait;
use TimestampableTrait;
```

Doctrine behavior
-----------------

[](#doctrine-behavior)

Originally this package used the `KnpLabs/DoctrineBehaviors`, but there is/was a [maintainer issue](https://github.com/KnpLabs/DoctrineBehaviors/issues/711). Therefore this bundle contains a new implementation of the most generally used behaviors, based on the original package.

> The implementation is not 100% equivalent to the original package.

Doctrine listeners for the behavior events are loaded automatically, but for the Blameable behavior you have to define which one is your User class (check the configuration part).

There are built-in implementations of the behavior interfaces attached to the base entities, but you can define your own if you want.

### Timestampable

[](#timestampable)

Timestampable handle the createdAt and updatedAt fields during persist and update.

Your entity have to implement the `Schvoy\BaseEntityBundle\Entity\Interfaces\Behavior\TimestampableInterface`.

### SoftDeleteable

[](#softdeleteable)

The behavior keeps the data in the database without real data removal, it is just set the deletedAt value on the entity.

This bundle provides extra helping methods for this behavior on the entity:

- delete()
- restore()
- isDeleted()
- willBeDeleted()

Your entity have to implement the `Schvoy\BaseEntityBundle\Entity\Interfaces\Behavior\SoftdeletableInterface`.

### Blameable

[](#blameable)

Tracks who did the changes on the entity during persist, update or remove (working only with soft delete).

When the entity implements the `Schvoy\BaseEntityBundle\Entity\Interfaces\Behavior\BlamableInterface` then the createdBy and updatedBy field are tracked during persist and update by default.

To track also the deletedBy during remove, your entity have to implements the `Schvoy\BaseEntityBundle\Entity\Interfaces\Behavior\SoftdeletableInterface`.

> The deletedBy field will be added to the entity even if the SoftDeleteable behavior is not used, but it will be always null.

Configuration reference
-----------------------

[](#configuration-reference)

Required config fo Blameable behavior

```
doctrine:
    orm:
        resolve_target_entities:
            Symfony\Component\Security\Core\User\UserInterface: Your\Namespace\User
```

> More information: [https://symfony.com/doc/current/doctrine/resolve\_target\_entity.html](https://symfony.com/doc/current/doctrine/resolve_target_entity.html)

###  Health Score

50

—

FairBetter than 95% of packages

Maintenance79

Regular maintenance activity

Popularity19

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity75

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~129 days

Recently: every ~141 days

Total

13

Last Release

108d ago

Major Versions

v0.9.0 → v1.0.02024-06-29

PHP version history (5 changes)v0.7PHP ^8.0

v0.8.0PHP ^8.1

v0.9.0PHP &gt;=8.1

v1.0.0PHP &gt;=8.3

v1.1.1PHP &gt;=8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/72cb4f136b5a24ed665d87f8481a6dbbe486f9d9676eda0425ff660ff54d0c82?d=identicon)[norbert.schvoy](/maintainers/norbert.schvoy)

---

Top Contributors

[![schvoy](https://avatars.githubusercontent.com/u/12039308?v=4)](https://github.com/schvoy "schvoy (35 commits)")

---

Tags

bundledoctrinephpsymfonysymfony-bundle

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/schvoy-base-entity-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/schvoy-base-entity-bundle/health.svg)](https://phpackages.com/packages/schvoy-base-entity-bundle)
```

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

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

Admin generator for Symfony applications

4.3k17.5M373](/packages/easycorp-easyadmin-bundle)[sulu/sulu

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

1.3k1.4M196](/packages/sulu-sulu)[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.8M462](/packages/pimcore-pimcore)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9317.2k55](/packages/open-dxp-opendxp)[kimai/kimai

Kimai - Time Tracking

4.7k8.7k1](/packages/kimai-kimai)

PHPackages © 2026

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