/** * @Flow\Around("method(TYPO3\Flow\Persistence\Doctrine\EntityManagerFactory->getEventManager())") * @param \TYPO3\Flow\Aop\JoinPointInterface $joinPoint The current join point * @return \Doctrine\Common\EventManager */ public function registerEntityAuditEventListenerToEventManager(\TYPO3\Flow\Aop\JoinPointInterface $joinPoint) { $eventManager = $joinPoint->getAdviceChain()->proceed($joinPoint); $classNamesAnnotatedAsVersionable = $this->reflectionService->getClassNamesByAnnotation('TYPO3\\Doctrine\\Versionable\\Annotations\\Versionable'); if (!is_array($classNamesAnnotatedAsVersionable)) { return; } foreach ($classNamesAnnotatedAsVersionable as $index => $className) { if (!$this->reflectionService->isClassAnnotatedWith($className, 'TYPO3\\Flow\\Annotations\\Entity')) { unset($classNamesAnnotatedAsVersionable[$index]); } } if ($classNamesAnnotatedAsVersionable !== array()) { $auditConfiguration = new \SimpleThings\EntityAudit\AuditConfiguration(); $auditConfiguration->setAuditedEntityClasses($classNamesAnnotatedAsVersionable); $auditManager = new \SimpleThings\EntityAudit\AuditManager($auditConfiguration); $auditManager->registerEvents($eventManager); } return $eventManager; }
/** * Gets the 'simplethings_entityaudit.config' service. * * This service is shared. * This method always returns the same instance of the service. * * @return \SimpleThings\EntityAudit\AuditConfiguration A SimpleThings\EntityAudit\AuditConfiguration instance. */ protected function getSimplethingsEntityaudit_ConfigService() { $this->services['simplethings_entityaudit.config'] = $instance = new \SimpleThings\EntityAudit\AuditConfiguration(); $instance->setAuditedEntityClasses(array(0 => 'Test\\TaskBundle\\Entity\\Category', 1 => 'Test\\TaskBundle\\Entity\\Product', 2 => 'Application\\Sonata\\UserBundle\\Entity\\User', 3 => 'Application\\Sonata\\UserBundle\\Entity\\Group', 4 => 'Application\\Sonata\\PageBundle\\Entity\\Page', 5 => 'Application\\Sonata\\PageBundle\\Entity\\Block', 7 => 'Application\\Sonata\\PageBundle\\Entity\\Snapshot', 8 => 'Application\\Sonata\\PageBundle\\Entity\\Site', 9 => 'Application\\Sonata\\NewsBundle\\Entity\\Post', 10 => 'Application\\Sonata\\NewsBundle\\Entity\\Comment', 11 => 'Application\\Sonata\\MediaBundle\\Entity\\Media', 12 => 'Application\\Sonata\\MediaBundle\\Entity\\Gallery', 13 => 'Application\\Sonata\\MediaBundle\\Entity\\GalleryHasMedia', 14 => 'Application\\Sonata\\CustomerBundle\\Entity\\Customer', 15 => 'Application\\Sonata\\CustomerBundle\\Entity\\Address', 16 => 'Application\\Sonata\\InvoiceBundle\\Entity\\Invoice', 17 => 'Application\\Sonata\\OrderBundle\\Entity\\Order', 18 => 'Application\\Sonata\\OrderBundle\\Entity\\OrderElement', 19 => 'Application\\Sonata\\ProductBundle\\Entity\\Product', 21 => 'Application\\Sonata\\ProductBundle\\Entity\\ProductCategory', 22 => 'Application\\Sonata\\ProductBundle\\Entity\\ProductCollection', 23 => 'Application\\Sonata\\ProductBundle\\Entity\\Delivery', 24 => 'Application\\Sonata\\CommentBundle\\Entity\\Comment', 25 => 'Application\\Sonata\\CommentBundle\\Entity\\Thread', 26 => 'Application\\Sonata\\ClassificationBundle\\Entity\\Category', 27 => 'Application\\Sonata\\ClassificationBundle\\Entity\\Tag', 28 => 'Application\\Sonata\\ClassificationBundle\\Entity\\Collection', 29 => 'Application\\Sonata\\NotificationBundle\\Entity\\Message', 30 => 'Sonata\\Bundle\\DemoBundle\\Entity\\Car', 31 => 'Sonata\\Bundle\\DemoBundle\\Entity\\Engine', 32 => 'Sonata\\Bundle\\DemoBundle\\Entity\\Inspection', 33 => 'Sonata\\Bundle\\DemoBundle\\Entity\\Color', 34 => 'Sonata\\Bundle\\DemoBundle\\Entity\\Material')); $instance->setGlobalIgnoreColumns(array()); $instance->setTablePrefix(''); $instance->setTableSuffix('_audit'); $instance->setRevisionFieldName('rev'); $instance->setRevisionTypeFieldName('revtype'); $instance->setRevisionTableName('revisions'); $instance->setRevisionIdFieldType('integer'); return $instance; }