Re: Model data structure inconsistent?

2013-06-12 Thread Frank Weindel
I fully agree with Rolan here. I know this topic is a few years old, but I was curious to find out if a solution ever came to fruition. The fact that I can't just easily derive a standalone $parent, a $node, or a $child regardless of what Model I use to do the initial find on is causing me

Model data structure inconsistent?

2010-05-07 Thread Roland Bock
Hi, sorry to bring this up again, but I firmly believe that model data structure is inconsistent. I really don't get the current logic and haven't found any documentation explaining it. Suppose you have these models: class Parent extends AppModel { var $hasMany = array('Node'); } class Node

Re: Model data structure inconsistent?

2010-05-07 Thread John Andersen
I do think that if you don't like something in CakePHP, please write your own solution to it, then offer it to the CakePHP developers. I don't see anything wrong with the structure. What you suggest is to add additional levels to the structure, just so that all records will look equal inside the

Re: Model data structure inconsistent?

2010-05-07 Thread Roland Bock
Hi, John Andersen wrote: I do think that if you don't like something in CakePHP, please write your own solution to it, then offer it to the CakePHP developers. Sure. I'd like to understand first, though :-) In CakePHP, Parent - Node - Child leads to different ways to handle a single Node:

Re: Model data structure inconsistent?

2010-05-07 Thread John Andersen
I agree that the structure could be better, but as it is, is the way we have to work with it, and I consider it sufficient for my usage. Enjoy, John On May 7, 12:30 pm, Roland Bock feedback2...@eudoxos.de wrote: Hi, John Andersen wrote: I do think that if you don't like something in

Re: Model data structure inconsistent?

2010-05-07 Thread Roland Bock
John Andersen wrote: I agree that the structure could be better, but as it is, is the way we have to work with it, and I consider it sufficient for my usage. Enjoy, John OK, two questions: a) Do you think I could tweak current Models with a Behavior in order to get the structure I prefer?

Re: Model data structure inconsistent?

2010-05-07 Thread John Andersen
Looking into the Model code, it looks like it is not there that you should apply the changes. The reading from the database of the main model (Parent) and the related models (Node, Ghost and Child) all take place in the DataSource, so you could probably write another DataSource and use that.

Re: Model data structure inconsistent?

2010-05-07 Thread Roland Bock
John Andersen wrote: Looking into the Model code, it looks like it is not there that you should apply the changes. The reading from the database of the main model (Parent) and the related models (Node, Ghost and Child) all take place in the DataSource, so you could probably write another

Re: Model data structure inconsistent?

2010-05-07 Thread Jamie
Hi Roland, What you're suggesting is a pretty major change to data returned by Cake - major in that there would be a lot of user-end code that needs changing if this were to happen to the core. Though I think it's awesome that you'd be willing to write a patch and submit it, maybe you should

Re: Model data structure inconsistent?

2010-05-07 Thread Roland Bock
Jamie, thanks for the reassurance :-) Submitting a ticket certainly is a good idea! Regards, Roland Jamie wrote: Hi Roland, What you're suggesting is a pretty major change to data returned by Cake - major in that there would be a lot of user-end code that needs changing if this were to

Re: Model data structure inconsistent?

2010-05-07 Thread Matthew Powell
Jamie said it once, but I feel it's worth repeating. Modifying the code to output in a format YOU want for your new application could pretty much screw up every cakephp application out there. Matt On Fri, May 7, 2010 at 10:33, Roland Bock feedback2...@eudoxos.de wrote: Jamie, thanks for

Re: Model data structure inconsistent?

2010-05-07 Thread Roland Bock
Matthew Powell wrote: Jamie said it once, but I feel it's worth repeating. Modifying the code to output in a format YOU want for your new application could pretty much screw up every cakephp application out there. Matt Matt, I am fully aware of that. And that is certainly not a decision

Re: Model data structure inconsistent?

2010-05-07 Thread Miles J
I don't see the benefit for this structure. Seems like twice the work for no gain. Cakes current implementation is best. The primary model and all relations usually return within the same dimension, as it does not need to be in hierarchical dimensions unless its a deep relationship. On May 7,

Re: Model data structure inconsistent?

2010-05-07 Thread Roland Bock
Miles J wrote: I don't see the benefit for this structure. Seems like twice the work for no gain. Cakes current implementation is best. The primary model and all relations usually return within the same dimension, as it does not need to be in hierarchical dimensions unless its a deep