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
1
vote
1 answer

Codeigniter Datamapper save() not actually saving to database

I'm running CodeIgniter 1.7.3, Datamapper DMZ 1.7.1 (and no, upgrading is not an option), MySQL 5.1, and the Cron Job Boostrapper for an application I'm building. I'm attempting to extract information from an XML file and save it into a database.…
Shauna
  • 9,495
  • 2
  • 37
  • 54
1
vote
2 answers

One To Many relationship codeigniter/datamapper

I need help on this plz : 2 tables Service : has many Sub_Service Sub_Service : has one Service My code : $services = new Service(); $services->where('org_id', $org_id)->get(); $services->sub_service->get(); foreach($services as…
1
vote
3 answers

Looping through "steps", then "sub-steps", then "sub-sub-steps" in PHP/CodeIgniter

I guess my first question is, since I'm the lone developer, I miss having others to throw ideas off of, or to get ideas when I'm stuck on a problem. Is there a site that's specific to solving that problem? Like a virtual co-programmer site? Or can…
TerryMatula
  • 1,264
  • 2
  • 14
  • 29
1
vote
1 answer

How to transform the results of a stored procedure in to a list of object then convert to json in CI?

I am using CodeIgniter 2.2.6 + DataMapper, I have a question regarding how to transform the results of a stored procedure into DataMapper Models, then convert them to json. I have a model called Event: class Event extends DataMapper { var $table…
seaguest
  • 2,510
  • 5
  • 27
  • 45
1
vote
0 answers

Datamapper Codeigniter use condition in where_related clause

Table Structure I have three Database tables as : 1.) Deal_Team id, deal_id, title, status, insert_time 2.) Deal_Team_User id, deal_team_id, user_id, status, insert_time 3.) Attachment_To_Deal_Team id, attachment_id, deal_team_id,…
1
vote
2 answers

Call to undefined method MY_Loader::_ci_load_library()

I'm new to Codeigniter, and currently I just installed Codeigniter 2.2.0 with HMVC and ORM Datamapper version 1.8.2 . I'm sure I have installed the ORM correctly, but when I test the Link, It give me this Fatal error: Call to undefined method…
acin
  • 13
  • 1
  • 4
1
vote
1 answer

Inner join in datamapper codeigniter

I have two table products and categories, I want to get all the products with their category name. Product Table(products) id (auto_increment) | Name(varchar) | category_id(int) | price(decimal) | user_id(int) Category Table(categories) …
Tomas
  • 514
  • 4
  • 13
  • 37
1
vote
0 answers

validation in Datamapper orm

hello below is my model array( 'label'=>'Name', …
1
vote
1 answer

Fatal error: Class 'Router' not found in application\third_party\datamapper\bootstrap.php

Please help me, I am integrating Datamapper ORM to my CodeIgniter Application Framewarork. I have follow the all rules as mentioned in official site. But once configuring, when i run my application it throws an Fatal error: Class 'Router' not…
Chintan7027
  • 7,115
  • 8
  • 36
  • 50
1
vote
4 answers

Like Query Is Not Working properly

In Code igniter Model I am using like query to fetch all the products having first name rice which is not working controller while using get_where('name') it works fine. public function fetchdeal_products($id) { $this->db->select('*'); …
1
vote
1 answer

Codeigniter: Categories and Subcategroies

I am trying to make a restaurant menu and I have to have Categories and Subcategories, so I created the following tables: Table: Categories ID NAME Table: Subcategories ID NAME PRICE DESCRIPTION …
Unsparing
  • 6,985
  • 2
  • 17
  • 33
1
vote
1 answer

CodeIgniter DataMapper with Nested Sets

I'm trying to get a basic example of CodeIgniter DataMapper Nested Sets working using the included Nested Sets extension to DataMapper. I have a table set up with a single tree in it: +------+--------------+---------+----------+ | id | name …
flyingL123
  • 7,686
  • 11
  • 66
  • 135
1
vote
2 answers

Codeigniter: How to make a desc order between 3 tables?

So I am using CodeIgniter and DataMapper. I made something like a wall where you can view articles link posts image posts. This are 3 different tables and each one of them have column called 'pubdate'. At the moment when you view the wall where all…
Unsparing
  • 6,985
  • 2
  • 17
  • 33
1
vote
3 answers

Does Datamapper for Codeigniter force an intermediate table for all relationships?

I'm moving towards an ORM for my codeigniter application and have chosen datamapper. However, in the rules section, it states the following: A joining table must exist between each related normal tables, regardless of the type of…
Michelle
  • 2,155
  • 4
  • 26
  • 42
1
vote
2 answers

Call variable from view in Codeigniter

I am trying to call $data['form_value'] from view in Codeigniter, but that array returns empty. Here is my Controller: $data['field'] = $this->cc->get_form_names($data['selid']); foreach($data['field'] as $key=>$valuee) { $data['form_value'] =…
Che Jug
  • 417
  • 6
  • 14