I want to send to my view 2 arrays - second one shouldn't have elements from the first one. I used Hash::diff but it doesn't work great with CakePHP arrays.
$edited = $this->Instrument->find('all', array(
'conditions'=>array(
'status' => '1'),
'fields' => array('Instrument.id',[and other fields]),
'order'=> array('modified'=>'desc'),
'limit'=>100
));
$new = $this->Instrument->find('all', array(
'conditions'=>array(
'status' => '1'),
'fields' => array('Instrument.id', [and other fields]),
'order'=> array('added'=>'desc'),
'limit'=>5
));
$this->set(array(
'edytowane'=>Hash::diff($edited, $new),
'nowe'=>$new
));
But after that I sometimes have few the same records in $edytowane
as in $new
variable. What do I wrong ? :)