[DOCTRINE][SCHEMADEF] Create a new metadata driver to allow us to continue using static schemaDef functions
This has the benefit of requiring fewer code changes, as well as providing a better isolation between GNU social and symfony, useful in case the framework needs to be changed
This commit is contained in:
15
src/Util/SchemaDefDriver.php
Normal file
15
src/Util/SchemaDefDriver.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Util;
|
||||
|
||||
use Doctrine\Persistence\Mapping\ClassMetadata;
|
||||
use Doctrine\Persistence\Mapping\Driver\StaticPHPDriver;
|
||||
|
||||
class SchemaDefDriver extends StaticPHPDriver
|
||||
{
|
||||
public function loadMetadataForClass($className, ClassMetadata $metadata)
|
||||
{
|
||||
$schema = $className::schemaDef();
|
||||
$metadata->addField($schema[0]);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user