Welcome Guest, Not a member yet? Register   Sign In
Elegant ORM
#1

[eluser]Unknown[/eluser]
Hi,

Recently I've just developed Elegant ORM (for CodeIgniter 2.x) which is based on Laravel's Eloquent ORM. Right now it's still in beta (still in manual test and lacks of inline documentation). But more features are coming. For the latest beta version, it provides:

- Basic querying (SELECT, INSERT, UPDATE & DELETE) with beautiful and simple syntax.
- Aggregates methods
- Relationship definition (One to One, One to Many and Many to Many)
- Eager loading support

Quote:View more about Elegant ORM project on GitHub: https://github.com/nazieb/elegant-orm

Give it a try and tell me what do you think!

Thanks
#2

[eluser]Unknown[/eluser]
Some examples:

Defining models

Code:
class User extends Elegant\Model {
  // the name of table to work with
  protected $table = "user";
}
// That's it!

Querying

Code:
// Get all users
$users = User::all();
foreach($users as $user)
{
  echo $user->name;
}

// Find particular user(s) by its primary key
$user = User::find(1);
echo $user->name;

Creating New Model
Code:
$user =  new User;

$user->name = 'John Doe';
$user->email = '[email protected]';

$user->save();

Updating Models
Code:
$user = User::find(1);

$user->name = 'Jack Doe';
$user->save();
#3

[eluser]od3n[/eluser]
can i use both CI Model and Elegent ORM together?




Theme © iAndrew 2016 - Forum software by © MyBB