ObjectQuel ORM
A powerful Object-Relational Mapping system built on the Data Mapper pattern, offering clean separation between entities and persistence logic. ObjectQuel combines a purpose-built query language with structured data enrichment, powered by CakePHP's robust database foundation.
The ObjectQuel Advantage
ObjectQuel addresses fundamental design challenges in object-relational mapping through its innovative architecture and developer-friendly approach.
🎯 Entity-Based Query Language
Write intuitive, object-oriented queries with the ObjectQuel language that feels natural to developers and abstracts complex SQL operations.
🏗️ Data Mapper Architecture
Keep entities decoupled from the database for clean, testable domain logic. No active record bloat in your business objects.
⚡ Performance By Design
Multiple built-in optimization strategies including intelligent query decomposition, lazy loading with proxies, and metadata caching.
🔗 Relationship Simplicity
Work with complex entity relationships through simple annotations. Support for OneToOne, OneToMany, ManyToOne, and ManyToMany patterns.
🌐 Hybrid Data Sources
Uniquely combine traditional databases with external JSON data sources in a single, unified query interface.
🛠️ Developer Tools
Sculpt CLI tool for entity generation, schema migrations, and reverse engineering from existing database tables.
Example Query
Here's what ObjectQuel query syntax looks like:
<?php
// Find products under $50 with their categories
$results = $entityManager->executeQuery("
range of p is App\\Entity\\ProductEntity
range of c is App\\Entity\\CategoryEntity via p.categories
retrieve (p, c.name) where p.price < :maxPrice
sort by p.name asc
", [
'maxPrice' => 50.00
]);
// Work with fully hydrated entities
foreach($results as $row) {
$product = $row['p']; // Full ProductEntity object
$categoryName = $row['c.name']; // Just the category name
echo $product->getName() . " in " . $categoryName;
}