Bindmodel to binded model? Cakephp -


enter image description here

i bind productsphoto children using bindmodel method:

$this->category->bindmodel(array             ('hasmany' => array(                 'productsphoto' => array...  

how can bind productsphoto every product item?

or maybe other solution suggestion?

in controller ,write below code

$this->productsphoto->bindmodel('hasmany' => array('product.productphoto_id' => 'productphoto.id'); 

in productphoto model,

var $hasmany = array(     'product' =>                 array(                     'classname' => 'productphoto',                     'foreignkey' => 'productphoto_id',                     'conditions' => '',                     'fields' => '',                     'order' => '',                     'countercache' => ''             ),    ); 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -