/** * Add a change log entry to track the change. * * @param string $contentType * @param integer $contentId * @param Content $newContent * @param Content|null $oldContent * @param string|null $comment */ private function logChange($contentType, $contentId, $newContent = null, $oldContent = null, $comment = null) { $type = $oldContent ? 'Update' : 'Insert'; $this->app['logger.change']->info($type . ' record', ['action' => strtoupper($type), 'contenttype' => $contentType, 'id' => $contentId, 'new' => $newContent ? $newContent->toArray() : null, 'old' => $oldContent ? $oldContent->toArray() : null, 'comment' => $comment]); }