Bindmodel to binded model? Cakephp -
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
Post a Comment