Is it possible to use bindModel to bind 3 different nested tables in CakePHP
Posted
by paullb
on Stack Overflow
See other posts from Stack Overflow
or by paullb
Published on 2010-05-13T16:00:56Z
Indexed on
2010/05/13
16:14 UTC
Read the original article
Hit count: 195
cakephp
I have a segment which can have many comments and each comment can have many tags. I can bind the comments to the segments using code like the below which is a function in the segment model class.
function prepareForGettingSegmentsWithComments() {
$this->bindModel(
array('hasMany' => array(
'Comment' => array(
'className' => 'Comment',
'foreignKey' => 'segmentID'
)
)
)
);
}
However how can I bind in the Tags as well?
© Stack Overflow or respective owner