Download the PHP package assegaiphp/orm without Composer

On this page you can find all versions of the php package assegaiphp/orm. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package orm

Assegai Logo

Latest release Tests PHP 8.4+ License Status active

A standalone ORM for modern PHP applications, with optional AssegaiPHP integration.

Description

An object-relational mapper for modern PHP applications. You can use it on its own, or plug it into AssegaiPHP when you want repository injection and framework conventions.

Contribution workflow

For commit and pull request conventions in this repo, see:

Installation

That is the preferred path inside an Assegai workspace. It will:

If you install the package manually first, assegai add orm is still safe to run afterward. It will just finish the workspace wiring.

For standalone PHP projects that are not using Assegai, install the package directly:

Then enable only the PDO driver you actually plan to use:

AssegaiORM no longer forces all three database extensions at install time. If you choose a driver without enabling its matching PDO extension, the ORM will tell you exactly which extension is missing when you try to connect.

Guide map

This package is designed to feel familiar to teams coming from TypeORM:

In the main Assegai guide set, the ORM track is:

Quick Start

Overview & Tutorial

Using it without Assegai

You can use AssegaiORM directly in any PHP project. The standalone path is:

  1. configure named databases for the ORM runtime
  2. create a DataSource
  3. create or fetch repositories from that data source

Hydrated reads

Reads retain their existing result shape by default. Pass hydrate: true when application code needs deterministic entity instances and entity property types:

The root row is a NoteEntity, and each explicitly requested relation is an instance of its declared target entity class. Column aliases are mapped to their entity property names, while backed enums, DateTime, and booleans use the ORM's normal conversion pipeline. Exclusion rules still apply after hydration, including sensitive-property defaults and explicit exclude overrides.

Using SQLite

SQLite is a good fit for local development, small apps, prototypes, and CLI tools. This ORM supports SQLite through PDO, so the first step is to register a named SQLite connection in your app config.

Make sure the pdo_sqlite extension is enabled and that the folder for your database file already exists. The configured path should be relative to your project's working directory.

You can then point an entity at that SQLite data source:

When you need SQL-only storage knobs such as engine, schema, or SQLite WITHOUT ROWID, keep the entity metadata focused on shared concerns and add the SQL companion attribute:

Legacy #[Entity(engine: ...)], #[Entity(schema: ...)], and #[Entity(withRowId: ...)] declarations still work, but new code should put SQL-specific storage options on #[SqlEntityOptions(...)].

Relation mental model

Relations follow the same ownership ideas you would expect from TypeORM:

Load relations explicitly in find() and findOne() calls, and prefer writing through the owner side of the relation. OneToMany collections do not need a reference-column argument; the ORM derives that from the owning ManyToOne/JoinColumn metadata.

If you want to use SQLite directly through the ORM, create a DataSource, ensure the table exists, and then work with the repository:

Using it inside Assegai

Inside Assegai, import OrmModule once or let assegai add orm wire it for you. That module registers the repository resolver so #[InjectRepository(...)] can participate in the framework injector cleanly.

Once the module is present, you can inject the repository and let the entity metadata select the SQLite connection:

Standalone first, framework optional

The ORM no longer needs assegaiphp/core to function. When the core package is present, the ORM can still read framework config and repository metadata automatically. When it is not present, Assegai\\Orm\\Support\\OrmRuntime acts as the lightweight runtime seam for config, module options, and logging.

Support

Assegai is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.

Stay in touch

License

Assegai is MIT licensed.


All versions of orm with dependencies

PHP Build Version
Package Version
Requires php Version >=8.4
ext-pdo Version *
ext-curl Version *
ext-intl Version *
assegaiphp/util Version ^0.10.0
psr/log Version ^3.0
symfony/console Version ^8.0
predis/predis Version ^2.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package assegaiphp/orm contains the following files

Loading the files please wait ...