DataMapper 1.6.0 |
[eluser]Iverson[/eluser]
Quote: I actually don't have that line in my datamapper file (1.6.0). And this isn't my actual situation. I just quoted it instead of saying the same thing over. My code is actually: Code: $cl = new Client(); And I'm running 5.2.8. Maybe that's a problem?
[eluser]OverZealous[/eluser]
Hmm, I must have modified MY version of DM already! Ha. OK, the correct line is to replace Code: // line # 2416 Code: unset($this->{$object->model}); I apologize, my DM has a handful of bugfixes that I'm pretty sure I sent to Stensi, but have long since forgotten about... Then your problem should be gone.
[eluser]Iverson[/eluser]
Thanks for the help, but that didn't work either. I think it's because #2416 is in a delete relationship function. All I'm trying to do is get the related table. Code: // Client Model
[eluser]OverZealous[/eluser]
Hmm, you need to be more specific when you post questions. The problem you referenced before was specifically related to deleting a related item, and is completely unrelated to the code you are showing. In your quoted text, you are using the old method. DataMapper 1.6.0 (actually, since 1.4.0) doesn't use the associative has_one and has_many arrays. You just need to list the model names of the related objects. Please read the DM change log. $unix_timestamp can also be specified within the DataMapper config file, and is not needed on the individual models unless you want different types of timestamps per model.
[eluser]tdktank59[/eluser]
Is there a way to get thing out of the relation table? For example: I need to get start_date and end_date from the roles_users table Quote:users UPDATE: For the moment im just using custom queries attached to the page and method models. If there is a way to do it with Datamapper sweet otherwise this is a work around for it at the moment...
[eluser]macigniter[/eluser]
i just found out about this beautifully documented class and am just now experimenting with it. i have one question and please excuse me if it is stupid: i ususally use prefixes for a logical group of tables (e.g. user management = user_****, tracking = track_**** etc.) so i have a "faqs" table as well as a "track_faqs" table which holds all the stats. technically i would join the tables like this: faqs id question answer ... track_faqs id hash created join_faqs_track_faqs id faq_id track_faq_id is it possible to use an underscore in a table name or is it forbidden?
[eluser]macigniter[/eluser]
another question... i have a "files" table that stores information on uploaded files. this table should have relations to 1. the user id of the user that uploaded the file (1:1) 2. a list of users that are allowed to view the file (m:n) how would i do this without having to use the same join table name twice? files id label descr ... created updated join_files_users (to store the user id of the creator of a file) id file_id user_id join_files_users (to store the users that are allowed to download a file) id file_id user_id i don't know how to solve this since i would have to use the same table name for the join tables, right?
[eluser]Murodese[/eluser]
Code: class Uploader extends DataMapper And join tables would become files_users and files_uploaders.
|
Welcome Guest, Not a member yet? Register Sign In |