/** * @dataProvider data_update_counters */ public function test_update_counters($model, $ids, $counters, $expected_sql) { $this->assertEquals($expected_sql, (string) Jam_Countcache::update_counters($model, $ids, $counters), 'message'); }
/** * If we're using count_cache, decrement the count_cache field on the foreign model * @param Jam_Model $model */ public function model_after_delete(Jam_Model $model) { if ($this->count_cache and $model->{$this->foreign_key}) { Jam_Countcache::decrement($this->foreign_model, $this->count_cache, $model->{$this->foreign_key}); } }