# |
Oct 22nd 2009, 09:37 |
dogmatic69 |
ionas: how? |
# |
Oct 22nd 2009, 09:37 |
dogmatic69 |
$publishers = $this->paginate( 'Publisher', array( 'contain' => 'Model' ) ); |
# |
Oct 22nd 2009, 09:36 |
ionas |
dogmatic69, yes |
# |
Oct 22nd 2009, 09:36 |
ionas |
t0nic, okay have fun, though if you are a newbie I really REALLY recommend BOOK + Cake Bake! |
# |
Oct 22nd 2009, 09:36 |
dogmatic69 |
anyone know how to use containable with paginate? |
# |
Oct 22nd 2009, 09:36 |
Iiridayn_ |
In my cached view file, lines 2-15 are dedicated to creating the controller object, even though I never use it in the view (not normally available), and to my knowledge since the View class doesn't store it normally, it doesn't use it there either |
# |
Oct 22nd 2009, 09:36 |
t0nic |
ionas: hmmm... I think I have enough answer already. I will pursue this further when problems arise. Thanks! |
# |
Oct 22nd 2009, 09:35 |
ionas |
t0nic, lookup database conventions, fire up cake bake and see what it bakes, you will be asked which relationships you like and you chose those fitting, then look at the core code |
# |
Oct 22nd 2009, 09:34 |
dakota |
Iiridayn_: What do you mean? |
# |
Oct 22nd 2009, 09:34 |
Iiridayn_ |
Or better said, what is the reason, and will you tell me? ;) |
# |
Oct 22nd 2009, 09:34 |
ionas |
(User HasMany Comment misses above) |
# |
Oct 22nd 2009, 09:34 |
Iiridayn_ |
Hi all, it's me again. Today my question has to do with cached views :). Is there a reason that the controller object is created at the top? |
# |
Oct 22nd 2009, 09:34 |
ionas |
(which equal) |
# |
Oct 22nd 2009, 09:34 |
ionas |
you will have 4 models, and 4 aliases to those |
# |
Oct 22nd 2009, 09:33 |
ionas |
User HasMany Video | Video BelongsTo User | Video HasMany Comment | Comment BelongsTo Video | Comment BelongsTo User |
# |
Oct 22nd 2009, 09:33 |
t0nic |
ionas ok, I think that answers my concern thanks :) |
# |
Oct 22nd 2009, 09:32 |
NoReGreT |
Phally: yeah, what is it in your opinion i meant |
# |
Oct 22nd 2009, 09:32 |
ionas |
t0nic, maybe someone else understands your question better, I would use the same alias only for one and the same "reference" to the same concept. Basically if you do $this->Foo->find() or $this->Foo->Bar->Foo->find() should make no difference |
# |
Oct 22nd 2009, 09:32 |
Phally |
NoReGreT: i did no say that |
# |
Oct 22nd 2009, 09:32 |
NoReGreT |
s/that you/the/ |
# |
Oct 22nd 2009, 09:32 |
Ceeram |
line #231 and #237 (which is teh same test btw) |
# |
Oct 22nd 2009, 09:32 |
NoReGreT |
Phally: i see, so that you concept you showed me is better ? |
# |
Oct 22nd 2009, 09:31 |
Phally |
) |
# |
Oct 22nd 2009, 09:31 |
Phally |
NoReGreT: and role based (User HABTM Group |
# |
Oct 22nd 2009, 09:31 |
Ceeram |
ok thx, then how can that test pass with you its expecting [Product][price] |
# |
Oct 22nd 2009, 09:31 |
Phally |
NoReGreT: not really, that is db based |
# |
Oct 22nd 2009, 09:30 |
Ceeram |
that would be in Product array i would say |
# |
Oct 22nd 2009, 09:30 |
markstory |
[0][price] |
# |
Oct 22nd 2009, 09:30 |
Ceeram |
and i mean data structure for MIN(Product.price) as price |
# |
Oct 22nd 2009, 09:30 |
t0nic |
I know you can't use the same alias on both sides of model1->model2 |
# |
Oct 22nd 2009, 09:30 |
Ceeram |
what would you say this would return: $result = $Product->find('all',array('fields'=>array('Product.type','MIN(Product.price) as price'),'group'=> 'Product.type',)); |
# |
Oct 22nd 2009, 09:30 |
t0nic |
*must* i use distinct aliases for User in a chain like User<-Video->Comment->User |
# |
Oct 22nd 2009, 09:29 |
markstory |
Ceeram: and I run the tests in 5.2.10 and 4.4.9 |
# |
Oct 22nd 2009, 09:29 |
ionas |
t0nic, I do not see your issue there |
# |
Oct 22nd 2009, 09:28 |
ionas |
t0nic, 'AliasName' => array('className' => 'ModelName') |
# |
Oct 22nd 2009, 09:28 |
Ceeram |
hmm |
# |
Oct 22nd 2009, 09:28 |
markstory |
I don't get any of the fails you do. |
# |
Oct 22nd 2009, 09:28 |
markstory |
Ceeram: no |
# |
Oct 22nd 2009, 09:27 |
Ceeram |
markstory: you dont get fail on ModelRead test? |
# |
Oct 22nd 2009, 09:27 |
t0nic |
http://is.gd/4vVNL "However, aliases must be unique both within a single model and on both sides of a belongsTo/hasMany or a belongsTo/hasOne relationship. Choosing non-unique names for model aliases can cause unexpected behavior." |
# |
Oct 22nd 2009, 09:27 |
ionas |
Comment: id, created, body, user_id, username, email, url - the latter 4 maybe NULL - its either user_id or those 3 fields filled with data |