Models and Entities

GitHub GitHub last commit CI Workflow GitHub code size in bytes GitHub Issues Total Downloads Monthly Downloads

Since 2006, I participated in FLISoL. In 2014, I presented SowerPHP at UTEM (Santiago, Chile). Years before, I presented MiPaGiNa at the University of Chile. On that occasion, someone in the audience said to me “Oh, you built an ORM,” and I said, “What is that?” That day, during the presentation I was giving, I learned what an ORM was. This project compiles the ideas that have appeared in my mind over the years. Always with the goal of making everything “automagical.”

– Esteban De La Fuente Rubio

derafu/orm does not implement an ORM: it uses Doctrine ORM and DBAL. It is a library, not a framework bundle, and its API is not stable yet.

Installation

PHP 8.5 or later is required.

composer require derafu/orm

Components

Class Purpose
EntityManagerFactory Create an EntityManager from an array of options (EntityManagerFactoryInterface)
ConnectionParametersFactory Create the parameters of the connection, with its DSN (ConnectionParametersFactoryInterface)
DoctrineRepositoryFactory, DoctrineRepository Give the entities of Doctrine through the repository manager of derafu/repository
DoctrineCliConfigurationFactory Create what the CLI of Doctrine Migrations needs, from a DSN or an array

Guides

  • Entity manager: the dbal and orm options, with the types, the caches and the errors.
  • Repositories: one repository manager for the entities of Doctrine and the data sources of derafu/repository.
  • Migrations: the configuration of the CLI of Doctrine Migrations, without a framework.
  • Symfony integration: wire the entity manager and the repository factory with Symfony DependencyInjection.
On this page

Last updated on 26/10/2026 by Anonymous