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.
ObjectQuel addresses fundamental design challenges in object-relational mapping through its innovative architecture and developer-friendly approach.
Write intuitive, object-oriented queries with the ObjectQuel language that feels natural to developers and abstracts complex SQL operations.
Keep entities decoupled from the database for clean, testable domain logic. No active record bloat in your business objects.
Multiple built-in optimization strategies including intelligent query decomposition, lazy loading with proxies, and metadata caching.
Work with complex entity relationships through simple annotations. Support for OneToOne, OneToMany, ManyToOne, and ManyToMany patterns.
Uniquely combine traditional databases with external JSON data sources in a single, unified query interface.
Sculpt CLI tool for entity generation, schema migrations, and reverse engineering from existing database tables.
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;
}