All pastes #925958 Raw Edit

Untitled

public text v1 · immutable
·published 2008-03-03 13:19 UTC
rendered paste body
    			$this->SaleDetail->unbindModel(array('belongsTo' => array('Product')));
    			$this->SaleDetail->unbindModel(array('belongsTo' => array('Sale')));
    			
    			//and update the field
		$this->SaleDetail->saveField('collected', 'true');

____ from model:
	var $belongsTo = array(
			'Sale' => array('className' => 'Sale',
								'foreignKey' => 'sale_id',
								'conditions' => '',
								'fields' => '',
								'order' => ''
			),
			
						'Product' => array('className' => 'Product',
								'foreignKey' => 'product_id',
								'conditions' => '',
								'fields' => '',
								'order' => ''
			)
	);