PHPackages                             omanshardt/doctrine-base-entities - 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. omanshardt/doctrine-base-entities

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

omanshardt/doctrine-base-entities
=================================

Helper library to provide base functionality to doctrine entities such as setting creation and modification date and interleaved checksumming of entities (checksumming every entity with respect to it's predescessor)

1.1.1(8y ago)017MITPHPPHP &gt;=5.3.0

Since Apr 17Pushed 8y ago1 watchersCompare

[ Source](https://github.com/omanshardt/doctrine-base-entities)[ Packagist](https://packagist.org/packages/omanshardt/doctrine-base-entities)[ Docs](https://github.com/omanshardt/doctrine-base-entities)[ RSS](/packages/omanshardt-doctrine-base-entities/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

doctrine-base-entities
======================

[](#doctrine-base-entities)

This Zend module provides base classes to simplify handling of doctrine entities. Currently it consists of

- two abstract entity classes
- one general repository class
- one service class

[![Latest Version](https://camo.githubusercontent.com/1e0a56dafe76aee6a5c4dbb2f159401a0a60901bc6a4f7ee60c8230ea3424349/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6f6d616e7368617264742f646f637472696e652d626173652d656e7469746965732e7376673f7374796c653d666c61742d737175617265)](https://github.com/omanshardt/doctrine-base-entities/releases) [![Total Downloads](https://camo.githubusercontent.com/eae6d3e67ba9e1cf4dc3a8505d28efc8a824408aec141c97bf5506603ad16372/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f6d616e7368617264742f646f637472696e652d626173652d656e7469746965732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/omanshardt/doctrine-base-entities) [![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

Install
-------

[](#install)

```
composer require omanshardt/doctrine-base-entities
```

Entity classes
--------------

[](#entity-classes)

- `MBBaseEntity` simplifies handling of creation and modification date by providing a `created` and a `modified` property along with its accessor methods as well as appropriate lifecycleevent methods to set creation and modification date on persist and modification date on update. So this has not to be implemented in every entity class on it's own. In addition this class defines an abstract class `getTextIdentifier()` that is very similar to an `getString()` method and that should return a suitable string representation of the entity.
- `MBInterleavedChecksumEntity` creates a simple checksum from provided record data as well as an interleaved checksum from provided record data alongside with data of the forerunning record (the predecessor). It defines an abstract method `getInterityData()` that needs to be implemented in the concrete entity class and returns an array of data that should be included within the checksum. This class also saves the id of it's predecessor into the current record.

Repository class
----------------

[](#repository-class)

- `MBInterleavedChecksumEntityRepository` provides the `findLatest()` method that returns the latest record within the corresponding table. Currently it does this by id (what means that this only works as intended if id is incremental).

Service class
-------------

[](#service-class)

- `IntegrityService` provides the `getValidatedEntities()` method that returns a list of all entities with their validity checked. This result is similar to the repository's method `findAll()` but with validation and is needed as validation is a tiime consuming process and should not happen on every findAll()` operation.

Usage
-----

[](#usage)

To use `MBBaseEntity` add the following fields to the table that is related to the entity.

- `created (DateTime)`
- `modified (DateTime)`

Extend the `MBBaseEntity` within the concrete entity class. Add a `getTextIdentifier()` method to the concrete class that returns a suitable string representation of the entity.

To use `MBInterleavedChecksumEntityRepository` do everything that has to be done for using `MBBaseEntity` (this is because `MBInterleavedChecksumEntityRepository` extends `MBBaseEntity`) and add the following fields to the table that is related to the entity.

- `simple_checksum (varchar(1000))`
- `interleaved_checksum (varchar(1000))`
- `predecessor_id (int)`

Extend the `MBInterleavedChecksumEntityRepository` within the concrete entity class. Add a `getInterityData()` method to the concrete class that returns an array of data that should be part of the simple and interleaved checksum.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 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 ~0 days

Total

2

Last Release

2946d ago

### Community

Maintainers

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

---

Top Contributors

[![omanshardt](https://avatars.githubusercontent.com/u/5845310?v=4)](https://github.com/omanshardt "omanshardt (8 commits)")

---

Tags

doctrine

### Embed Badge

![Health badge](/badges/omanshardt-doctrine-base-entities/health.svg)

```
[![Health](https://phpackages.com/badges/omanshardt-doctrine-base-entities/health.svg)](https://phpackages.com/packages/omanshardt-doctrine-base-entities)
```

###  Alternatives

[scienta/doctrine-json-functions

A set of extensions to Doctrine that add support for json query functions.

58523.9M36](/packages/scienta-doctrine-json-functions)[laravel-doctrine/orm

An integration library for Laravel and Doctrine ORM

8425.3M87](/packages/laravel-doctrine-orm)[damienharper/auditor-bundle

Integrate auditor library in your Symfony projects.

4542.8M](/packages/damienharper-auditor-bundle)[knplabs/doctrine-behaviors

Doctrine Behavior Traits

92212.7M64](/packages/knplabs-doctrine-behaviors)[sonata-project/doctrine-orm-admin-bundle

Integrate Doctrine ORM into the SonataAdminBundle

46117.7M155](/packages/sonata-project-doctrine-orm-admin-bundle)[fresh/doctrine-enum-bundle

Provides support of ENUM type for Doctrine2 in Symfony applications.

4636.8M12](/packages/fresh-doctrine-enum-bundle)

PHPackages © 2026

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