Description
Corma is a high-performance, convention-based ORM based on Doctrine DBAL.
Croute is great because:
Corma alternatives and similar libraries
Based on the "Database" category.
Alternatively, view Corma alternatives based on common mentions on social networks and blogs.
-
Doctrine Extensions
Doctrine2 behavioral extensions, Translatable, Sluggable, Tree-NestedSet, Timestampable, Loggable, Sortable -
ProxyManager
🎩✨🌈 OOP Proxy wrappers/utilities - generates and manages proxies of your objects -
Eloquent
[READ ONLY] Subtree split of the Illuminate Database component (see laravel/framework) -
Baum
Baum is an implementation of the Nested Set pattern for Laravel's Eloquent ORM. -
Idiorm
A lightweight nearly-zero-configuration object-relational mapper and fluent query builder for PHP5. -
Propel
Propel2 is an open-source high-performance Object-Relational Mapping (ORM) for modern PHP -
Doctrine2 Behaviors
Doctrine2 behavior traits that help handling Blameable, Loggable, Sluggable, SoftDeletable, Uuidable, Timestampable, Translatable, Tree behavior -
Spot2
Spot v2.x DataMapper built on top of Doctrine's Database Abstraction Layer -
Aura.SqlQuery
Independent query builders for MySQL, PostgreSQL, SQLite, and Microsoft SQL Server. -
Atlas.Orm
A data mapper implementation for your persistence model in PHP. -
Cake ORM
[READ-ONLY] A flexible, lightweight and powerful Object-Relational Mapper for PHP, implemented using the DataMapper pattern. This repo is a split of the main code that can be found in https://github.com/cakephp/cakephp -
Elasticsearch Eloquent
⚡️ Models like Eloquent for Elasticsearch. -
Simple MySQLi Class
:gem: Simple MySQLi Abstraction Layer + Doctrine/DBAL support -
LDBA
High-performance, low-memory-footprint, single-file embedded database for key/value storage -
PHP library access Firebase RESTful API
A working Firebase http client -
Symfony-RDM
Helps with the use of domain driven design & rich domain model in symfony / doctrine applications. -
LazyRecord
The fast ORM for PHP. (This is a history repo, please visit maghead/maghead)
TestGPT | Generating meaningful tests for busy devs
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of Corma or a related project?
Popular Comparisons
README
Corma
Corma is a high-performance, convention-based ORM based on Doctrine DBAL.
Corma is great because:
- No complex and difficult to verify annotations or configuration files
- Promotes consistent code organization
- Loads and saves one-to-one, one-to-many, and many-to-many relationships with a method call
- Can save multiple objects in a single query (using an upsert)
- Makes it easy to cache and avoid database queries
- Supports soft deletes
- Makes it easy to handle transactions in a Unit of Work
- Highly customizable
Corma doesn't:
- Autoload or lazy load relationships by default
- Do migrations or code generation
Works in MySql and PostgreSQL.
Install via Composer
Via the command line:
composer.phar require thewunder/corma ~3.0
Or add the following to the require section your composer.json:
"thewunder/corma": "~3.0"
For PHP version > 5.5 < 7.1 use Corma version ~2.0
Basic Usage
Create a DataObject
namespace YourNamespace\Dataobjects;
class YourDataObject {
protected $id;
//If the property name == column name on the table your_data_objects it will be saved
protected $myColumn;
//Getters and setters..
}
And a Repository (optional)
namespace YourNamespace\Dataobjects\Repository;
class YourDataObjectRepository extends ObjectRepository {
//Override default behavior and add custom methods...
}
Create the orm and use it
$db = DriverManager::getConnection(...); //see Doctrine DBAL docs
$orm = ObjectMapper::withDefaults($db);
$object = $orm->create(YourDataObject::class);
//Call setters...
$orm->save($object);
//Call more setters...
$orm->save($object);
//Call more setters on $object...
$objects = [$object];
$newObject = $orm->create(YourDataObject::class);
//call setters on $newObject..
$objects[] = $newObject;
$orm->saveAll($objects);
//find existing object by id
$existingObject = $orm->find(YourDataObject::class, 5);
//find existing objects with myColumn >= 42 AND otherColumn = 1
$existingObjects = $orm->findBy(YourDataObject::class, ['myColumn >='=>42, 'otherColumn'=>1], ['sortColumn'=>'ASC']);
//load relationships
$orm->loadOne($existingObjects, OtherObject::class, 'otherObjectId');
$orm->loadMany($existingObjects, AnotherObject::class, 'yourObjectId');
$orm->loadManyToMany($existingObjects, DifferentObject::class, 'link_table');
//delete those
$orm->deleteAll($existingObjects);
Documentation
See the wiki for full documentation.
Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
*Note that all licence references and agreements mentioned in the Corma README section above
are relevant to that project's source code only.