brokencube / automatorm
Simple schema-led ORM, with no code generation required
Installs: 5 473
Dependents: 0
Suggesters: 1
Security: 0
Stars: 3
Watchers: 2
Forks: 1
Open Issues: 4
Requires
- php: >=7.0.0
- psr/cache: ^1.0
- psr/log: ^1.0
- psr/simple-cache: ^1.0
Requires (Dev)
- phpunit/php-code-coverage: ^6.0
- phpunit/phpunit: ^7.0
- dev-master
- 6.2.3
- 6.2.2
- 6.2.1
- 6.2.0
- 6.1.0
- 6.0.0
- 5.0.1.1
- 5.0.1.0
- 5.0.0.0
- 4.1.0.0
- 4.0.0.1
- 4.0.0.0
- 3.12.0.0
- 3.11.1.0
- 3.11.0.0
- 3.10.0.0
- 3.9.0.1
- 3.9.0.0
- 3.8.0.1
- 3.8.0.0
- 3.7.0.1
- 3.7.0.0
- 3.6.0.0
- 3.5.2.0
- 3.5.1.0
- 3.5.0.1
- 3.5.0.0
- 3.4.2.0
- 3.4.1.0
- 3.4.0.0
- 3.3.1.0
- 3.3.0.1
- 3.3.0.0
- 3.2.0.1
- 3.2.0.0
- 3.1.2.0
- 3.1.1.1
- 3.1.1.0
- 3.1.0.3
- 3.1.0.2
- 3.1.0.1
- 3.1.0.0
- 3.0.2.0
- 3.0.1.1
- 3.0.1.0
- 3.0.0.6
- 3.0.0.5
- 3.0.0.4
- 3.0.0.3
- 3.0.0.2
- 3.0.0.1
- 3.0.0.0
- 2.0.0.0
- 1.1.1.0
- 1.1.0.3
- 1.1.0.2
- 1.1.0.1
- 1.1.0.0
- 1.0.1.0
- 1.0.0.4
- 1.0.0.3
- 1.0.0.2
- 1.0.0.1
- 1.0.0.0
- 0.12.1.0
- 0.12.0.0
- 0.11.0.0
- 0.10.0.3
- 0.10.0.2
- 0.10.0.1
- 0.10
- 0.9.4
- 0.9.3.2
- 0.9.3.1
- 0.9.3
- 0.9.2.3
- 0.9.2.2
- 0.9.2.1
- 0.9.2
- 0.9.1
- 0.9
- dev-newquerybuilder
This package is not auto-updated.
Last update: 2022-05-14 04:02:31 UTC
README
A simple to use ORM in PHP, that reads your database schema directly, without having to run code generators, or create schema documents.
Installation
$ composer require brokencube\automatorm
Requirements
PHP 7.0 + PDO (Currently only MySQL supported - expect to support other engines in the future)
Basic Example
<?php use Automatorm\Orm\{Model,Schema}; use Automatorm\DataLayer\Database\Connection; // Class that is linked to the table "blog" - namespace is linked to a particular schema + connection namespace models { class Blog extends Model {} } // Get db connection $connection = Connection::register($pdo); // Get db schema for the ORM and assign to 'models' namespace as above Schema::generate($connection, 'models'); // Find a table row based on a simple where clause $blog = Blog::find(['title' => 'My Blog']); // Select * from blog where title = 'My Blog'; echo $blog->id; // Prints "1" echo $blog->title; // Prints "My First Entry"
A more detailed layout of how to use the ORM can be found in the Wiki