/** * @param Aggregation $aggregation * @param Snapshot $snapshot * @param bool $suppress */ public function addSnapshot(Aggregation $aggregation, Snapshot $snapshot, $suppress = false) { $snapshot->aggregation_id = $aggregation->id; $aggregation->count_occurred->inc(1); $aggregation->last_occurred_time = time(); if ($suppress) { $this->suppressSnapshot($aggregation); $snapshot->setSuppressed(); } else { $aggregation->count_stored->inc(1); } }
/** * @param Snapshot $snapshot */ public function delete(Snapshot $snapshot) { $snapshot->setDeleted(); $this->save($snapshot); }