enhanced plugin support (#634)

- refactored admin controller and templates
- plugin support for entity actions
- changed column mail to email in customer table
- refactored theme events
This commit is contained in:
Kevin Papst
2019-03-11 14:46:30 +01:00
committed by GitHub
parent 519be2d5a2
commit 3ac72a5c89
104 changed files with 1878 additions and 976 deletions

View File

@@ -11,6 +11,7 @@ namespace App\Doctrine;
use Doctrine\Common\Persistence\Mapping\ClassMetadata;
use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration as BaseAbstractMigration;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -50,6 +51,55 @@ abstract class AbstractMigration extends BaseAbstractMigration implements Contai
return getenv('DATABASE_PREFIX') . $name;
}
/**
* @param Schema $schema
* @throws DBALException
*/
public function preUp(Schema $schema): void
{
$this->abortIfPlatformNotSupported();
}
/**
* @param Schema $schema
* @throws DBALException
*/
public function preDown(Schema $schema): void
{
$this->abortIfPlatformNotSupported();
}
/**
* Abort the migration is the current platform is not supported.
*
* @throws DBALException
*/
protected function abortIfPlatformNotSupported()
{
$platform = $this->getPlatform();
if (!in_array($platform, ['sqlite', 'mysql'])) {
$this->abortIf(true, 'Unsupported database platform: ' . $platform);
}
}
/**
* @return bool
* @throws DBALException
*/
protected function isPlatformSqlite()
{
return ($this->getPlatform() === 'sqlite');
}
/**
* @return bool
* @throws DBALException
*/
protected function isPlatformMysql()
{
return ($this->getPlatform() === 'mysql');
}
/**
* @return string
* @throws DBALException
@@ -84,7 +134,7 @@ abstract class AbstractMigration extends BaseAbstractMigration implements Contai
protected function addSqlDropIndex($indexName, $tableName)
{
$dropSql = 'DROP INDEX ' . $indexName;
if ($this->getPlatform() === 'mysql') {
if (!$this->isPlatformSqlite()) {
$dropSql .= ' ON ' . $tableName;
}
$this->addSql($dropSql);