update on find(‘neighbours’) with HABTM
And, here, to cap off a really terrible brain day, is the solution, using cake’s core functionality, to the find(‘neighours’) with habtm conundrum!
$this->Mixture->bindModel(array('hasOne'=>array('MixtureCategoriesMixture')), false);
$this->set('neighbours', $this->Mixture->find('neighbors', array(
'field' => 'Mixture.sku', 'value' => $this->data['Mixture']['sku'],
'conditions'=>array(
'MixtureCategoriesMixture.default'=>1,
'MixtureCategoriesMixture.mixture_category_id'=>$this->data['MixtureCategory'][0]['id'],
'Mixture.status'=>1
)
)));
Doh, doh doh!