Download the PHP package sympress/orm without Composer

On this page you can find all versions of the php package sympress/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

SymPress ORM

Checks Release PHP Downloads

Status: WIP (Work in Progress)

Doctrine-inspired ORM primitives for WordPress projects that keep wpdb as the database runtime.

The package is intentionally not a full Doctrine ORM replacement. It brings the parts that are useful in a WordPress package architecture: attribute-based entity metadata, repositories, a Doctrine-like entity manager, deferred flush() writes, simple query building, schema SQL generation, and optional integration with sympress/migration.

WordPress remains the runtime. Existing plugins, core tables, $wpdb, and WordPress APIs continue to work normally.

Installation

When sympress/kernel is active, the package is discovered as a library bundle and registers its services and console commands automatically.

The root project should also require sympress/migration when ORM-managed schema migrations should be registered and executed through the migration system.

Features

Entity Mapping

Table names are stored without the WordPress prefix. The ORM adds $wpdb->prefix at runtime, so sympress_mailer_logs becomes wp_sympress_mailer_logs on a default install.

If table is omitted, the table name is derived from the short class name: EmailLog becomes email_log.

If a #[Column] name is omitted, the property name is converted to snake case: createdAt becomes created_at.

Supported Column Types

The schema generator maps common Doctrine-style types to MySQL types suitable for WordPress tables:

Unknown types are passed through as raw SQL type names.

Entity Manager

The entity manager follows the normal Doctrine workflow: persist() schedules work, and flush() writes the changes.

Calling persist() does not immediately call $wpdb->insert() or $wpdb->update(). The entity is registered in the UnitOfWork. The SQL write happens during flush().

Change Tracking

Managed entities are snapshotted when they are persisted, inserted, or hydrated from a query. Later changes are detected during flush().

Only changed columns are sent to $wpdb->update(). Identifier columns are not updated.

Removing Entities

remove() schedules a deletion. The row is deleted during flush().

If a new entity is persisted and then removed before the next flush, the pending insertion is cancelled.

Identity Map

The UnitOfWork keeps an identity map for managed entities. Repeated find() calls for the same entity class and identifier return the already managed object when possible.

Use detach() to stop tracking one entity or clear() to reset all managed state.

Repositories

Every entity can use the base Repository, or a custom repository can be set on the entity attribute.

Resolve repositories through the entity manager:

The repository helpers accept an optional $flush argument for common small workflows:

Query Builder

The query builder accepts entity fields and compiles them to prefixed table and column names.

The generated SQL still goes through $wpdb->prepare().

Keep dynamic values out of query strings. The builder validates mapped field paths and prepares parameter values, but it cannot make interpolated strings safe. Put request data in setParameter() or setParameters() instead of concatenating it into where(), andWhere(), orWhere(), having(), andHaving(), join() conditions, or DQL strings. orderBy() only accepts mapped field paths; choose from an allow-list before passing user-controlled sort fields.

Supported query builder features:

DQL-Style Queries

The ORM includes a pragmatic DQL-style subset for reads and bulk writes:

Supported DQL subset:

Bulk DQL queries can be executed through execute():

This is not a full Doctrine DQL parser. Subqueries, partial object hydration, full AST walkers, and the complete Doctrine grammar are not part of this package yet. Lightweight custom DQL functions and SQL output walkers can be registered on the entity manager.

Transactions

Use transactional() for unit-of-work style transactions.

The callback is wrapped in:

If the callback or flush fails, ROLLBACK is executed and the original exception is rethrown.

Schema SQL

The SchemaTool generates WordPress-friendly table SQL from entity metadata.

For the example EmailLog entity, this produces a CREATE TABLE statement with:

CREATE TABLE statements are compatible with the migration package's WordPressSqlExecutor, which routes them through dbDelta().

Migration Bridge

When both sympress/orm and sympress/migration are installed, the ORM bridge registers schema migrations automatically during the db_migration_register hook.

Each entity manager group receives one generated migration object. Its version uses a schema hash:

When entity metadata changes, the schema hash changes. The migration package treats the changed hash as pending, so the generated schema migration can run again.

The bridge is optional:

Console Commands

The package exposes commands through the SymPress kernel console integration.

orm:migrations:diff generates a concrete AbstractMigration class containing the current SQL statements. Use this when you want explicit, reviewable migration files instead of only dynamic schema migrations.

WordPress Compatibility Rules

The ORM is built for custom package tables, not for replacing WordPress core APIs.

Recommended rules:

Current Limitations

The package is intentionally small and pragmatic. These features are not part of the current implementation:

These can be added incrementally without changing the basic entity manager and repository workflow.

Testing

In the root project, the package can also be tested directly:

Local vendor/ and PHPUnit cache directories are ignored by the package .gitignore.

License

This package is licensed under GPL-2.0-or-later.


All versions of orm with dependencies

PHP Build Version
Package Version
Requires php Version ^8.5
ext-json Version *
symfony/console Version ^8.0
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 sympress/orm contains the following files

Loading the files please wait ...