I have to find time to recreate this to see what goes wrong. I might have to do with the fact that you use advanced relationship definitions, it seems detection of the table alias goes wrong…
@maikens AFAIK the where_related() only accept string for field parameter.
You can find more explanation about where() and its variations from the documentation http://datamapper.wanwizard.eu/pages/getadvanced.html
But in your case, maybe you can use the following:
@WanWizard Thanks so much
I really do wish datamapper keeps better and better everytime.
So far, this is the easiest but powerful ORM for codeigniter I can find from google.
thank you WanWizard, I really appreciate it.
Wow, 80 hour weeks?? Take your time, man, get some rest.
I do wish you can take a little look at my problem, but I think I can find out the alternative way meanwhile.
Just, take your time.
Yeah, busy times. I’m designing a new datacenter for a client, I need to run my company, I’m project lead for another PHP framework, board member in another large OSS project, and then I have to find time to maintain Datamapper. And some sleep… Ah, well, you can sleep when your dead…
Thanks a lot @WanWizard, I didnt think you will fix it so quick, thanks so much, man, I will give it a try.
And..wow…I can’t imagine even for a second, I’m in your position…got tons of responsibilities yet giving a lot of contributions to the communities, you really bring your life a priceless worth, man…
And, umm…don’t tell me you do that only for bandwidth..
I really wish you keep those great works up!
Thank you once more..
Thanks a lot @WanWizard, I didnt think you will fix it so quick, thanks so much, man, I will give it a try.
And..wow…I can’t imagine even for a second, I’m in your position…got tons of responsibilities yet giving a lot of contributions to the communities, you really bring your life a priceless worth, man…
And, umm…don’t tell me you do that only for bandwidth..
I really wish you keep those great works up!
Thank you once more..
No, I stopped doing it for bandwidth a long time ago, but the nick and avatar stayed.
I do it for posts like this. Thanks! (Oh, and because it’s fun to do…)
Hello WanWizard.
I have just discovered one serious bug in self relationship model.
Here is the scenario: create absolute copy of this http://ellislab.com/forums/viewthread/196220/#923408 It wi.ll perfectly work. But if add new field named ‘organization’ (the same as model) - my local apache server will crash!
I’m sure that there is no need to fix that, but it need to be mentioned (maybe here http://datamapper.wanwizard.eu/pages/reservednames.html).
How would you formulate the query to get all objects of a specific class that don’t have a relationship with another class?
For examples, I have a class PERSON(id, firstname, lastname) that connects to EMPLOYMENT (id, start_date, end_date, person_id) which connects to COMPANY(id, company_name) using the table companies_employments(id, company_id, employment_id).
I want to be able to populate a list of all instances of PERSON that don’t have an EMPLOYMENT. (Forget about start and end_dates, I just want to see a list of person where there is no employment record for).
So in pseudo SQL : SELECT * FROM PERSON WHERE person.id NOT IN (array of all person_id in employment table)
Hello WanWizard.
I have just discovered one serious bug in self relationship model.
Here is the scenario: create absolute copy of this http://ellislab.com/forums/viewthread/196220/#923408 It wi.ll perfectly work. But if add new field named ‘organization’ (the same as model) - my local apache server will crash!
I’m sure that there is no need to fix that, but it need to be mentioned (maybe here http://datamapper.wanwizard.eu/pages/reservednames.html).
I find it difficult to believe that some PHP code in a model class can crash your webserver.
And I don’t understand what you want added to the reserved names. “organisation” isn’t a reserved name.