DataMapper ORM v1.8.2 |
[eluser]WanWizard[/eluser]
Looks like you have defined the relation 'group' as required. Giving 'group_id' a value doesn't make the related 'group' object magically appear.
[eluser]Maglok[/eluser]
I just wanted to confirm something about join fields. The include_join_fields() examples in the user guide say this: Code: // Create User What if I have a collection of users that I need to get the include_join_fields() for? This works, but seems like dirty coding to me: Code: // Get Users What is the best practice here?
[eluser]jordanarseno[/eluser]
Update -- Ignore This I found my answer here: http://stackoverflow.com/questions/54485...datamapper Hey WanWizard/folks. I understand that Datamapper ORM supports both MySQL and Postgres backends. The application I'm building requires both. What's your suggestion for getting it running on both databases at once? There are a few ways I can see this working -- forgive me if I've just missed the documentation: 1) I could put a field on the model ... var $db = "postgres"; or var $db = "mysql"; for instance. 2) Separate the postgres models into a new models folder ... /application/pgmodels for instance. 3) Prefix the postgres models with Pg... Pganimal() for instance. What's your suggestion here? As always, your help is appreciated.
[eluser]kakallatt[/eluser]
Hi WanWizard, I have 2 classes: Code: class User extends DataMapper { When I delete a user I got a database error: Code: Table 'cms.pages_users' doesn't exist
[eluser]Damir Sivic[/eluser]
"A joining table must exist between each $has_many related normal tables." DM manual "Joining tables must be named with both of the table names it is joining, in alphabetical order, separated by an underscore (_). For example, the joining table for users and countries is countries_users." DM manual
[eluser]kakallatt[/eluser]
[quote author="Damir Sivic" date="1367846376"]"A joining table must exist between each $has_many related normal tables." DM manual "Joining tables must be named with both of the table names it is joining, in alphabetical order, separated by an underscore (_). For example, the joining table for users and countries is countries_users." DM manual[/quote] I think: One to many or many to one don't need a joinning table. In pages table, I have a field named: user_id.
[eluser]Damir Sivic[/eluser]
Quote: but the error says that you using many to many relationship.
[eluser]kakallatt[/eluser]
[quote author="Damir Sivic" date="1367918837"] Quote: but the error says that you using many to many relationship.[/quote] It is so weird. I don't understand, in user class I defined: Code: var $has_many = array('page'); and page class: Code: var $has_one = array('user');
[eluser]Damir Sivic[/eluser]
Code: class User extends DataMapper { this is many to one...
[eluser]kakallatt[/eluser]
[quote author="Damir Sivic" date="1367940358"] Code: class User extends DataMapper { this is many to one...[/quote] I edited: Code: class User extends DataMapper { But I still got error: Code: Table 'cms.pages_users' doesn't exist |
Welcome Guest, Not a member yet? Register Sign In |