PHPackages                             timostamm/orm-resource - 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. timostamm/orm-resource

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

timostamm/orm-resource
======================

Store files in a Doctrine ORM database

v2.0.1(8mo ago)0691MITPHPPHP ^8.0CI passing

Since Sep 20Pushed 8mo ago2 watchersCompare

[ Source](https://github.com/timostamm/orm-resource)[ Packagist](https://packagist.org/packages/timostamm/orm-resource)[ RSS](/packages/timostamm-orm-resource/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (5)Dependencies (6)Versions (6)Used By (0)

ORM Resources
=============

[](#orm-resources)

[![build](https://github.com/timostamm/orm-resource/workflows/CI/badge.svg)](https://github.com/timostamm/orm-resource/actions?query=workflow:%22CI%22)[![Packagist PHP Version](https://camo.githubusercontent.com/19f82db04738ba0346d315f55034a0f906ff68d9764cec3ed4beec9fc4b1148f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f74696d6f7374616d6d2f6f726d2d7265736f757263652f706870)](https://camo.githubusercontent.com/19f82db04738ba0346d315f55034a0f906ff68d9764cec3ed4beec9fc4b1148f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f74696d6f7374616d6d2f6f726d2d7265736f757263652f706870)[![GitHub tag](https://camo.githubusercontent.com/705107d45924c3083afbf3889c3e117bc6025ea00e68ce6714f2154334f6523b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7461672f74696d6f7374616d6d2f6f726d2d7265736f757263653f696e636c7564655f70726572656c65617365733d26736f72743d73656d76657226636f6c6f723d626c7565)](https://github.com/timostamm/orm-resource/releases/)[![License](https://camo.githubusercontent.com/d6bc2b26794002c24d023acaab01b6dbb953c57ab9cb80ba5b8aa2f2bd5de99a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c7565)](#license)

Doesn't actually store the files in the database, but puts them in a storage directory and references them in the database.

This package uses timostamm/web-resource for file representation.

Files in the file system are never deleted.

Example
-------

[](#example)

The library supports both **PHP 8 Attributes** and **Doctrine Annotations** for mapping definitions.

### Using PHP 8 Attributes

[](#using-php-8-attributes)

```
use Doctrine\ORM\Mapping as ORM;
use TS\Web\Resource\Entity\EmbeddedResource;
use TS\Web\Resource\ResourceInterface;

#[ORM\Entity]
class TestEntity
{
    #[ORM\Embedded(class: EmbeddedResource::class)]
    private $file;

    public function getFile(): ?ResourceInterface
    {
        return $this->file;
    }

    public function setFile(?ResourceInterface $resource): void
    {
        $this->file = EmbeddedResource::create($resource);
    }

}

$em->getEventManager()
    ->addEventSubscriber(new ORMResourceHandler(new HashStorage($storageDir)));

$e = new TestEntity();
$e->setFile(Resource::fromFile(__FILE__));

$em->persist($e);
$em->flush($e);
```

### Using Doctrine Annotations

[](#using-doctrine-annotations)

```
use Doctrine\ORM\Mapping as ORM;
use TS\Web\Resource\Entity\EmbeddedResource;
use TS\Web\Resource\ResourceInterface;

/**
 * @ORM\Entity()
 */
class TestEntity
{
    /**
     * @ORM\Embedded(class = EmbeddedResource::class)
     */
    private $file;

    public function getFile(): ?ResourceInterface
    {
        return $this->file;
    }

    public function setFile(?ResourceInterface $resource): void
    {
        $this->file = EmbeddedResource::create($resource);
    }

}

$em->getEventManager()
    ->addEventSubscriber(new ORMResourceHandler(new HashStorage($storageDir)));

$e = new TestEntity();
$e->setFile(Resource::fromFile(__FILE__));

$em->persist($e);
$em->flush($e);
```

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance60

Regular maintenance activity

Popularity10

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 55% 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 ~646 days

Total

5

Last Release

254d ago

Major Versions

v1.1.0 → v2.0.02025-09-16

PHP version history (3 changes)v1.0.0PHP ^7.1.3

v1.1.0PHP ^7.2 || ^8.0

v2.0.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/6364011a12f22cb5046056371bde6170218218c560eddfdc08b4644b7648af78?d=identicon)[timostamm](/maintainers/timostamm)

---

Top Contributors

[![ducrot](https://avatars.githubusercontent.com/u/3525119?v=4)](https://github.com/ducrot "ducrot (11 commits)")[![timostamm](https://avatars.githubusercontent.com/u/4289451?v=4)](https://github.com/timostamm "timostamm (9 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/timostamm-orm-resource/health.svg)

```
[![Health](https://phpackages.com/badges/timostamm-orm-resource/health.svg)](https://phpackages.com/packages/timostamm-orm-resource)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M379](/packages/easycorp-easyadmin-bundle)[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.

1175.2k](/packages/rcsofttech-audit-trail-bundle)[kimai/kimai

Kimai - Time Tracking

4.8k8.7k1](/packages/kimai-kimai)[api-platform/doctrine-orm

Doctrine ORM bridge

294.4M83](/packages/api-platform-doctrine-orm)

PHPackages © 2026

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