Welcome Guest, Not a member yet? Register   Sign In
DataMapper ORM v1.8.0
#81

[eluser]WanWizard[/eluser]
That would be simple, but i'm not for that, as it would possibly load the database with the incorrect settings.

I prefer the user (of Datamapper) to be conscious of how the interaction with the database takes place, given the fact that you can configure Datamapper work indenpently from CI's database config through the datamapper config file. If you configure that properly (check dbparms), datamapper will autoload a database connection (which will then not be available though $this->db in CI).
#82

[eluser]Basketcasesoftware[/eluser]
Well, here's a suggestion - it's probably a better one for the whole CI framework but you know how long that'll take! - database name prefixes. Same reason as table prefixes - to prevent name collisions. My current host does this right now if I create a database causing me to have to add by hand to any database names in my profiles that prefix. Minor, but annoying.
#83

[eluser]WanWizard[/eluser]
I'm afraid they are one and the same.

Datamapper uses CI's database layer (and config) to access the database, it doesn't know databases. Unless you use the datamapper dbparms config value to define your own database settings, but then adding a prefix isn't a problem.
#84

[eluser]Basketcasesoftware[/eluser]
Yep. That's what I had been thinking would be the case. Figured I'd ask anyways. :cheese:
#85

[eluser]Gamesh[/eluser]
Hi,

So what is exactly reciprocal relationship? new in DM 1.8.

the documentation isn't very clear. is it basically a relationship where if you delete an object that has a reciprocal relationship, related object are also deleted ? instead of just removing relations ?

would be nice if someone explained this. I can't event find a term like reciprocal db relation.
#86

[eluser]Basketcasesoftware[/eluser]
[quote author="Gamesh" date="1297776195"]Hi,

So what is exactly reciprocal relationship? new in DM 1.8.

the documentation isn't very clear. is it basically a relationship where if you delete an object that has a reciprocal relationship, related object are also deleted ? instead of just removing relations ?

would be nice if someone explained this. I can't event find a term like reciprocal db relation.[/quote]

I remember reading that once. Hold on. If wanwizard doesn't beat me to it I'll have an answer soon.
#87

[eluser]Basketcasesoftware[/eluser]
It means there is a two-way connection between objects and anything done to one is reflected to the connected object (or record - whichever you prefer). It is a standard db term but it's not one I deal with a lot. I know for a fact it shows up in Microsoft Access documentation but it's been a while since I read up on it.
#88

[eluser]Gamesh[/eluser]
Quote:two-way connection between objects and anything done to one is reflected to the connected object

still not very clear. Are you saying that changing a field, lets say name in a record that has a reciprocal relation, would also change the name of the related object ?
perhaps an example would help.
#89

[eluser]Basketcasesoftware[/eluser]
[quote author="Gamesh" date="1297779273"]
Quote:two-way connection between objects and anything done to one is reflected to the connected object

still not very clear. Are you saying that changing a field, lets say name in a record that has a reciprocal relation, would also change the name of the related object ?
perhaps an example would help.[/quote]

Nope. Fields are not connected in DataMapper, records are. And they are not connected within the records themselves but by a separate mapping table. There are no foreign keys in your basic tables.

So, changing data within a record has no affect on anything it's joined to, regardless of the type of relationship between the records.

Reciprocal relationships only matter with record insertion or deletion. An example would be the deletion of a user and it causes all the postings and comments by that user in a blog system to also be deleted.
#90

[eluser]Gamesh[/eluser]
ahh Smile ok, thaks for clearing it up Smile




Theme © iAndrew 2016 - Forum software by © MyBB