示例#1
0
 /**
  * @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');
 }
示例#2
0
 /**
  * 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});
     }
 }