Questions tagged [codeigniter-datamapper]

An ORM library for CodeIgniter that builds on CodeIgniter's existing ActiveRecord library. Despite its name, it does not use the DataMapper pattern, but is instead an implementation of the ActiveRecord pattern.

DataMapper is an Object-Relational Mapper that builds on ActiveRecord. Data is loaded from database tables into objects, and relationships can be managed through simple, easy-to-read functions.

DataMapper ORM adds several important features to original DataMapper library, further enhancing it's usage, usually without requiring any code changes.

DataMapper offers these features:

  • Everything is an object!
  • Easy to setup, easy to use.
  • Custom Validation on object properties.
  • Lazy Loading (related objects are only loaded upon access).
  • Relations and their integrity are automatically managed for you.
  • One to One, One to Many, and Many to Many relations fully supported.
  • Select data in the style of Active Record (with or without Method Chaining).

Datamapper User Guide: http://datamapper.wanwizard.eu/
CodeIgniter wiki page: http://codeigniter.com/wiki/DataMapper_ORM/
Current release discussions : http://codeigniter.com/forums/viewthread/190990/

247 questions
0
votes
1 answer

Error 1054 in Codeigniter 2.1.3

I have the 1054 error in Codeigniter and I don't know why. I want to create a login form and check if the user is logged or not. But I only create a simple view and controller and the following error is displayed: Error Number: 1054 Unknown column…
axmug
  • 476
  • 2
  • 10
  • 26
0
votes
1 answer

CodeIgniter core changes

CI looks for Segment[1] for controller (in controller dir) and Segment[2] for Method. Now, I have specific requirement by business application which needs that I do not want CI to look or by force go to controller dir to load but I will have…
Umer
  • 133
  • 2
  • 11
0
votes
1 answer

CodeIgniter Datamapper save one to many 1:n

I'm using codeigniter and datamapper to create an invoicing app. an Invoice has_many Invoice_item I'm trying to save new Invoice_items against an Invoice. If i do the following: $invoice = new Invoice(1474); $invoice_item1 = new…
jx12345
  • 1,650
  • 2
  • 22
  • 40
0
votes
1 answer

CodeIgniter datamapper selecting empty columns

I am trying to select empty columns using datamapper. Below is what I tried: $u = new test(); $u->where("id",1); $u->select('name'); $u->get(); $u->result_count(); I am trying to find out whether the name column is empty or not. If the…
Shazad Maved
  • 235
  • 1
  • 5
  • 12
0
votes
1 answer

CodeIgniter DataMapper order of related items

I'm writing an invoicing application in CodeIgniter/DataMapper. Each customer has many invoices. In the view, I want to be able to display customer data and then a table of the invoices for that customer. At the moment, I load the customer and their…
jx12345
  • 1,650
  • 2
  • 22
  • 40
0
votes
1 answer

Codeigniter Datamapper ORM issue with array and object?

I have a block code: // Creat a object $privilege = new Privilege(); // Get all privileges $privilege->get_iterated(); $privileges = $privilege->all_to_array(array('id', 'name', 'description')); // Get user privileges …
Joshua Hansen
  • 405
  • 1
  • 8
  • 21
0
votes
1 answer

Extensible DataMapper ORM?

We are looking at adding DataMapper ORM into our Code Igniter HMVC setup. DataMapper looks very cool, but I noticed that the models are all tightly coupled with the has_one and has_many E.g. from the datamapper docs: class User extends DataMapper…
Hailwood
  • 89,623
  • 107
  • 270
  • 423
0
votes
1 answer

Datamapper comparing strings SQL and PHP

I'm trying to compare two strings using CodeIgniter and Data Mapper with PHP and MySQL, I found the function similar_text for PHP and using it in this function: $v = new Vendedor(); $v -> get(); foreach ($v as $vv) { $n = $vv -> name . " " . $vv…
Laura
  • 21
  • 3
0
votes
1 answer

from_array() method in Datamapper ORM Codeigniter

I'm using DATAMAPPER ORM V1.8.2. I have a question for from_array method: Firstly, I have a dropdown with *name="group_id"*