Part of the EllisLab Network
   
99 of 100
99
DataMapper 1.6.0
Posted: 23 September 2009 11:51 AM   [ Ignore ]   [ # 981 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  811
Joined  06-10-2009

I don’t think Datamapper supports in table foreign keys, so every relation amongst two tables must have its own join table.

Check out Overzealous Extension to Datamapper for support of in-table foreign keys, which eliminate the need for join tables in cases of has_one relationships.

 Signature 

CreativeHalls Web Design and Printing
A few of my projects:
OurGulfCoast Property Management and Vacation Rental (ASP/.NET)
BukuBux - Money Saving Coupons and Gift Certificates (CodeIgniter, LAMP/MySQL)
Rentals800.com - Find a place to rent (CodeIgniter, LAMP/MySQL)
bdh (dot) hall (at) gmail (dotcom)

Profile
 
 
Posted: 15 October 2009 05:47 AM   [ Ignore ]   [ # 982 ]  
Summer Student
Total Posts:  12
Joined  10-12-2009

I was wondering How I would go about this with datamapper,

I have a clients table and a clients_clients table that links a client as a child of another clinet (id, parent_id, child_id)

But it doesnt seem to work,  can datamapper models relate to them selfs?

I have jst had a look under the advanced relationshops section still a bit confused though

Sorry if what i write seems confusing smile

Cheers.

Profile
 
 
Posted: 15 October 2009 06:35 AM   [ Ignore ]   [ # 983 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  886
Joined  10-08-2008

@ennis
I hate to keep repeating myself, but if you want more advanced features (such as self relationships), you should switch to using DMZ, my extended version of DataMapper.

The discussion board is available in my signature, and you can learn a lot more about it from the link above.

 Signature 

Phil DeJarnett
  OverZealous Creations, LLC
  ZESTYJOBS - Job Management Powered by CI/DMZ

  DataMapper OverZealous Edition: Advanced ORM for CodeIgniter Discuss NEW 1.7

Profile
 
 
Posted: 15 October 2009 06:44 AM   [ Ignore ]   [ # 984 ]  
Summer Student
Total Posts:  12
Joined  10-12-2009

Was just about to post smile

  var $has_many = array(
      ‘relatedclient’ => array(
        ‘class’ => ‘client’,
        ‘other_field’ => ‘client’
      ),
      ‘client’ => array(
        ‘other_field’ => ‘relatedclient’
      )
  );

Thanks you I figured it out was already using DMZ thanks

Profile
 
 
Posted: 18 October 2009 06:46 AM   [ Ignore ]   [ # 985 ]  
Grad Student
Avatar
Rank
Total Posts:  76
Joined  08-29-2007

Hi,
As far as I understood everything is an object.

So if I have a car (table: cars) and this car has a color (table: colors) I have two models, a car model and a color model, right?

So let’s say my car has a lot more attributes, e.g. what kind of tyres, what kind of radio, what kind of seats etc, I have also the tables “tyres”, “radios”, “seats” etc, right?

So let’s assume I want to bundle these attributes and set a prefix only for the car’s attributes. How can I do this?

I want to have the “main objects” like “car” without any table-prefix. But attributes should be with a prefix. I know how to set a join-prefix and a table-prefix for certain models. Then I can also set the table name für “plurals”. Could I do the following to realize the grouping (same prefix for the car’s attributes):

Color-Model:
$table = ‘car_colors’;
$prefix = ‘’;
$join_prefix = ‘join_’;

Car-Model:
$table = ‘cars’;
$prefix = ‘’;
$join_prefix = ‘join_’;

etc.

Would that work?

Thanks for your help!!!

 Signature 

Visit the german-speaking CI-community at http://codeigniter.ch
FreeBSD- and Server-Tutorials at http://serverzeit.de

Profile
 
 
Posted: 18 October 2009 04:41 PM   [ Ignore ]   [ # 986 ]  
Grad Student
Avatar
Rank
Total Posts:  76
Joined  08-29-2007

Sorry for spamming this thread, but is Datamapper still under active development, e.g. update to more recent versions of CodeIgniter if necessary?

 Signature 

Visit the german-speaking CI-community at http://codeigniter.ch
FreeBSD- and Server-Tutorials at http://serverzeit.de

Profile
 
 
Posted: 20 October 2009 10:41 PM   [ Ignore ]   [ # 987 ]  
Summer Student
Total Posts:  1
Joined  10-10-2009

I’m studying any Codeigniter ORM, is this project still active ?
Thanks in advance.

Profile
 
 
Posted: 17 February 2010 05:35 AM   [ Ignore ]   [ # 988 ]  
Grad Student
Rank
Total Posts:  83
Joined  05-31-2008

HI,

can you please tell me benefits of DMZ DataMapper against Doctrine? Why i should use DMZ Datamaper instead of Doctrine?

 Signature 

http://www.MIMAteam.com

Profile
 
 
Posted: 17 February 2010 03:12 PM   [ Ignore ]   [ # 989 ]  
Grad Student
Avatar
Rank
Total Posts:  78
Joined  02-13-2008
OverZealous - 15 October 2009 06:35 AM

@ennis
I hate to keep repeating myself, but if you want more advanced features (such as self relationships), you should switch to using DMZ, my extended version of DataMapper.

The discussion board is available in my signature, and you can learn a lot more about it from the link above.

Follow this

 Signature 

Sorry for my pour english :(

Profile
 
 
Posted: 26 February 2010 08:51 AM   [ Ignore ]   [ # 990 ]  
Grad Student
Avatar
Rank
Total Posts:  58
Joined  10-15-2008

I had weird issue using Datamapper. If I do this :

$myObject->where('id', $id)->get();
I have not the same result as :
$myObject->get_by_id($id)->get();

Using the get_by_id method I have all the object even if ID exists. Using the where method I have the object I requested.

Any idea? I didn’t take a closer look to those method within the lib yet.

 Signature 

CodeIgniter french community | communauté francophone pour CodeIgniter

Profile
 
 
   
99 of 100
99
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 819, on March 11, 2010 11:15 AM
Total Registered Members: 120512 Total Logged-in Users: 34
Total Topics: 126580 Total Anonymous Users: 6
Total Replies: 665474 Total Guests: 371
Total Posts: 792054    
Members ( View Memberlist )
Newest Members:  12sarah123CasERispukgendaleOptimizaiofficeiEclipsekinkadebbbBenAbramsasantisteban