Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
createComparator example
private
function
updateSchema
(
)
: void
{
if
(
null !==
$this
->schemaSynchronizer
)
{
$this
->schemaSynchronizer->
updateSchema
(
$this
->
getSchema
(
)
, true
)
;
return
;
}
$schemaManager
=
$this
->
createSchemaManager
(
)
;
$comparator
=
$this
->
createComparator
(
$schemaManager
)
;
$schemaDiff
=
$this
->
compareSchemas
(
$comparator
,
method_exists
(
$schemaManager
, 'introspectSchema'
)
?
$schemaManager
->
introspectSchema
(
)
:
$schemaManager
->
createSchema
(
)
,
$this
->
getSchema
(
)
)
;
$platform
=
$this
->driverConnection->
getDatabasePlatform
(
)
;
if
(
!
method_exists
(
SchemaDiff::
class
, 'getCreatedSchemas'
)
)
{
foreach
(
$schemaDiff
->
toSaveSql
(
$platform
)
as
$sql
)
{
$this
->driverConnection->
executeStatement
(
$sql
)
;
}
return
;
}