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 - 01-05-2009 [eluser]ntheorist[/eluser] @zool you need to set up validation in your model Code: class User extends DataMapper { hope that helps. CC DataMapper 1.6.0 - El Forum - 01-06-2009 [eluser]MirceaBotez[/eluser] Anyone know what happened to stensi.com ? Datamapper docs seem to be gone from there... And while I'm here: has anyone tried DM with multiple (2) databases? If so, can you please share how? DataMapper 1.6.0 - El Forum - 01-06-2009 [eluser]BaRzO[/eluser] It's happened Yesterday night you can download DM ( latest ) at first message all documents included in it DataMapper 1.6.0 - El Forum - 01-06-2009 [eluser]stensi[/eluser] Sorry guys. I'm in the middle of moving servers at the moment so as BaRzO mentioned, the latest DM version can be downloaded via the Source Files link in the first post (or my sig) or from the DM page in the CI Wiki. For convenience, here's the download link again: DataMapper 1.6.0 The transfer is taking up a lot of my time so I haven't had a chance to fully catch up on the snazzy stuff commandercool's been doing. @MirceaBotez: gusa posted a while back how he'd modifed DM to allow the ability for defining which database group a model can use. View the details here: http://ellislab.com/forums/viewreply/478198/ Note that there will be issues if any of the related tables are on separate databases. For example, if you have a User model on Database A and a Group model on Database B, with the joining table on either, it will fail to work properly. Basically, you'll want to have all related tables on the same database. DataMapper 1.6.0 - El Forum - 01-14-2009 [eluser]ntheorist[/eluser] hey i'm playing with the idea of expanding DM again to include abstract data fields in the relationship tables (or at least allow for it to be applied).. So, instead of having just the relationship table such as a table 'groups_users' with the fields [id, user_id, group_id], you could add fields such as [id, user_id, group_id, sort_order, member_status, join_date, etc..] i figure since the three primary fields are there (id user_id group_id), everything should work as normal, but you'd be able to pull out relationship-specific information, or even search based on relationship data. For instance, i have an Album model and a Photo model, and i want to be able to sort the photos within an album and store that information, but the tables themselves shouldn't have relationship data in them (either case this would be terribly inefficient to manage) anyone have any feedback on this idear? CC DataMapper 1.6.0 - El Forum - 01-20-2009 [eluser]tdktank59[/eluser] UPDATE: Found the problem... The controllers name was the same as the models... Problem fixed now. Im having an issue with the get function Error Message: Code: [20-Jan-2009 14:35:03] PHP Fatal error: Call to undefined method Brainstorm::get() in /home/fourtwo1/public_html/dirt/application/controllers/brainstorm.php on line 18 Controller Code: class Brainstorm extends Controller { Model Code: <?php datamapper is being autoloaded DataMapper 1.6.0 - El Forum - 01-21-2009 [eluser]Unknown[/eluser] hi all. just playing around with the datamapper today and revealing how powerful it is. it will be a great tool to further increase the speed of developing apps. I wanted to create a helper to determine the current position within the returned array in a foreach loop. I can return the total array elements fine "count(Object->all)" but I can't seem to get hold of the numeric key for each array. Has anyone done this before and could perhaps provide some pointers. thanks. DataMapper 1.6.0 - El Forum - 01-22-2009 [eluser]ntheorist[/eluser] @expo have you tried $keys = array_keys($obj->all); ? you can also access the keys with a foreach Code: foreach($obj->all as $key => $row){ CC DataMapper 1.6.0 - El Forum - 01-22-2009 [eluser]wolffc[/eluser] Is it possible to give an order column to the joining table? Lets say a user can pick 3 of 10 options and set a specific order. Would they be inserted and retrived in the same order? Thanks DataMapper 1.6.0 - El Forum - 01-22-2009 [eluser]tdktank59[/eluser] So im having a problem saving a relationship... For some reason no error shows up even tho it is failing... and on top of that its inserting the brainstorm but not the user relation... I have removed the forms and stuff its just the datamapper stuff, Everything is being passed properly too So let me know if you have any ideas... Also all variables defined that are not show do exist... Controller Code Code: $b = New Brainstorm(); brainstorm model Code: var $table = 'brainstorms'; User Model Code: var $has_many = array("brainstorm"); |