cwbit/cakephp-aggregate-cache — pull request #7 by busgurlu (2014-09-28 08:27:10+00:00)
Title: allow multiple aggredated fields

Fixes an issue where there are multiple aggregated fields from different relations. Otherwise it will try to run the aggregation for different relations on the trigering relation.

Example:

class ReceiptLine extends AppModel {
public $actsAs = array('AggregateCache.AggregateCache'=>array(array(
'field'=>'amount',
'model'=>'Receipt',
'sum'=>'total',
'recursive'=>-1
)));
public $belongsTo = array('Receipt');
}

class Payment extends AppModel {
public $actsAs = array('AggregateCache.AggregateCache'=>array(array(
'field'=>'amount',
'model'=>'Receipt',
'sum'=>'amount_paid'
)));
public $belongsTo = array('Receipt');
}