I think that what you want is the fields element in the Album model's
association array for Image, something like:
$hasMany = array ('Image' = array ('fields' = array
('Image.name','Image.id')))
I don't remember exactly if you need the 'Image.' part or not...
You can dynamically change this
Write a method in your model that calls $this-query (), then you can call
it from your controller $this-Model-method ().
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake
PHP group.
To post to this group, send
And you are right with bindModel function. When I removed
hasAndBelongsToMany association from one of my model and binded it in
action function del() $model-del() function didn't remove associations
from DB.
I've been in a similar situation. I'm building an app that has around 30
models and
$this-ModelA-ModelB-save (array ('ModelB' = $modelb2));
$this-ModelA-ModelB-save (array ('ModelB' = $modelb3));
..This code first saves the data of $modelb2 and then replaces it
with the data of $modelb3. How do I save $modelb3 to a new 'ModelB'?
Add
$this-ModelA-ModelB-create();
between
I had the same problem. Make sure the link to favicon.ico is root-
relative (/favicon.ico). Otherwise the server's looking for /
controller/action/favicon.ico and the broken link gets captured as
the current page. Same thing for your css and js.
I figured this one out after looking at Ticket #518 in trac:
https://trac.cakephp.org/ticket/518
Thought it might help someone else out.
Associations set with bindModel are removed after a query on the primary
model. For instance, if you have a model Event and you bind the model
Contact with a
Try adding the other
model in your HABTM to the uses array and add that bindModel call under
your current one and see if that helps.
No luck. I didn't have that relationship in the other model before I removed
the static associations anyway. In my experience, there's really no need to
have