/** * Persist a new log object. * * Wraps call in a transaction so it does not mess with any other controller * functionality or database calls. * * @param LogInterface $log * @return LogInterface */ private function persistLog(LogInterface $log) { $this->manager->transactional(function ($em) use($log) { $em->persist($log); }); return $log; }