DataMapper 1.6.0 - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: DataMapper 1.6.0 (/showthread.php?tid=11358) Pages:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
DataMapper 1.6.0 - El Forum - 03-31-2009 [eluser]Oblique[/eluser] >I think you you are over-complicating something unnecessarily. Consider this as my favourite activity. ) Thank you for reasonable answer, i think it'll help. DataMapper 1.6.0 - El Forum - 04-07-2009 [eluser]tdktank59[/eluser] Not sure how self relations work in the new version. Heres my table: Quote:Members I want to be able to relate parent_member_id to id so I can set the parent member account. Code: class Member extends DataMapper DataMapper 1.6.0 - El Forum - 04-07-2009 [eluser]OverZealous[/eluser] Code: $has_one = array( To access the parent: Code: $member = new Member(); To access the children: Code: $children = $member->member->get(); Saving: Code: $member->save_parent_member($parent); DataMapper 1.6.0 - El Forum - 04-09-2009 [eluser]tdktank59[/eluser] Thanks DataMapper 1.6.0 - El Forum - 04-12-2009 [eluser]aman_tuladhar[/eluser] $u = new User(); $u->get_where( array('email' => 'fred@Smith.com') ); $u->package->get(); <-- Something wrong here with this method echo $u->package->title; I keep getting this error A Database Error Occurred Error Number: 1054 Unknown column 'packages.*' in 'field list' SELECT `packages`.`*` FROM (`packages`) LEFT JOIN `packages_users` ON `packages`.`id` = `packages_users`.`package_id` LEFT JOIN `users` ON `users`.`id` = `packages_users`.`user_id` WHERE `users`.`id` = 1 DataMapper 1.6.0 - El Forum - 04-12-2009 [eluser]Junior_Coder[/eluser] Good Job... Well done... DataMapper 1.6.0 - El Forum - 04-12-2009 [eluser]OverZealous[/eluser] @aman_tuladhar If you read the (original) DataMapper manual, you will see that it explains that problem in detail on the troubleshooting page, using the exact error you show. DataMapper 1.6.0 - El Forum - 04-12-2009 [eluser]aman_tuladhar[/eluser] ahh... I see Thanks a Lot DataMapper 1.6.0 - El Forum - 04-14-2009 [eluser]camporter1[/eluser] I'm having difficulty understanding how we do self referencing. In the examples in the docs, it's assumed there are different categories to work with for models that are self referenced. What about situations where there is no way to distinguish between one record and another? If anyone has examples for doing this, that would be great. Otherwise, I'll just write a specific part of my application without DataMapper, which might be a problem... Thanks. DataMapper 1.6.0 - El Forum - 04-14-2009 [eluser]OverZealous[/eluser] @camporter1 You should look at my extended version of DM. It doesn't change the way existing DM code is written, but it provides a lot of new features, including much more powerful self-references. I don't have as nice of documentation, but I did try to include some examples. You can view and download the latest version from here. It is a drop-in replacement for DM. Please give it a try, and you can leave feedback for me here, or through a private message. |