PHP code example of jtreminio / entity-audit-bundle
1. Go to this page and download the library: Download jtreminio/entity-audit-bundle library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
jtreminio / entity-audit-bundle example snippets
use Doctrine\ORM\EntityManager;
use Doctrine\Common\EventManager;
use SimpleThings\EntityAudit\AuditConfiguration;
use SimpleThings\EntityAudit\AuditManager;
$auditconfig = new AuditConfiguration();
$auditconfig->setAuditedEntityClasses(array(
'SimpleThings\EntityAudit\Tests\ArticleAudit',
'SimpleThings\EntityAudit\Tests\UserAudit'
));
$auditconfig->setGlobalIgnoreColumns(array(
'created_at',
'updated_at'
));
$evm = new EventManager();
$auditManager = new AuditManager($auditconfig);
$auditManager->registerEvents($evm);
$config = new \Doctrine\ORM\Configuration();
// $config ...
$conn = array();
$em = EntityManager::create($conn, $config, $evm);
class DefaultController extends Controller
{
public function indexAction()
{
$auditReader = $this->container->get("simplethings_entityaudit.reader");
}
}