In the most of systems need to save data somewhere and in some way. ORM (Object-Relational Mapping), is the way of mapping the system to the database. ORM is the layer between database and application which deals with creating, updating, reading and deleting.
class User extends Eloquent {
}
$user = User::find(123);
$user->name = ‘Philip Brown’;
$user->save();
First we inherit Eloquent (which is ActiveRecord type of ORM - just his name is Eloquent) and then i wave save() method which will save our information in the object.
DataMapper is ORM style that do not inherit classes like Eloquent (ActiveRecord). For example DataMapper is Doctrine. It looks like this:
$user = new User;
$user->setName(‘Philip Brown’);
EntityManager::persist($user);
EntityManager::flush();
User class is just empty object without inherit. We put them to the EntityManager persist method, and after we call flush() all pushed data to persist() will be saved. This works with transactions.
CodeIgniter
CodeIgniter uses a modified version of the Active Record Database Pattern. This pattern allows information to be retrieved, inserted, and updated in your database with minimal scripting. In some cases only one or two lines of code are necessary to perform a database action. CodeIgniter does not require that each database table be its own class file. It instead provides a more simplified interface.
Laravel
The Eloquent ORM included with Laravel provides a beautiful, simple ActiveRecord implementation for working with your database. Each database table has a corresponding "Model" which is used to interact with that table. Models allow you to query for data in your tables, as well as insert new records into the table.