Merge branch 'master' of ssh://172.20.0.1/var/git/espo/backend
This commit is contained in:
@@ -28,7 +28,7 @@ class EntityManager
|
||||
'dbname' => $config->get('database.dbname'),
|
||||
'user' => $config->get('database.user'),
|
||||
'password' => $config->get('database.password'),
|
||||
'metadata' => $this->getContainer()->get('metadata')->getEspoMetadata(),
|
||||
'metadata' => $this->getContainer()->get('metadata')->getOrmMetadata(),
|
||||
);
|
||||
|
||||
$entityManager = new \Espo\Core\ORM\EntityManager($params);
|
||||
|
||||
@@ -50,7 +50,7 @@ class Converter
|
||||
public function getSchemaFromMetadata()
|
||||
{
|
||||
if (!isset($this->schemaFromMetadata)) {
|
||||
$databaseMeta = $this->getMetadata()->getEspoMetadata();
|
||||
$databaseMeta = $this->getMetadata()->getOrmMetadata();
|
||||
$entityDefs = $this->getMetadata()->get('entityDefs');
|
||||
|
||||
$schema = $this->getSchemaConverter()->process($databaseMeta, $entityDefs);
|
||||
@@ -85,7 +85,7 @@ class Converter
|
||||
$databaseMeta = $this->getOrmConverter()->prepare($databaseMeta);
|
||||
|
||||
//save database meta to a file espoMetadata.php
|
||||
$result = $this->getMetadata()->setEspoMetadata($databaseMeta);
|
||||
$result = $this->getMetadata()->setOrmMetadata($databaseMeta);
|
||||
|
||||
|
||||
$GLOBALS['log']->add('Debug', 'Converter:process() - End: converting metadata to orm format and database schema, result=['.$result.']');
|
||||
|
||||
@@ -199,13 +199,13 @@ class Metadata
|
||||
}
|
||||
|
||||
|
||||
public function getEspoMetadata()
|
||||
public function getOrmMetadata()
|
||||
{
|
||||
if (!empty($this->espoMetadata)) {
|
||||
return $this->espoMetadata;
|
||||
}
|
||||
|
||||
$espoMetadataFile = Util::concatPath($this->getMetaConfig()->cachePath, 'espoMetadata.php');
|
||||
$espoMetadataFile = Util::concatPath($this->getMetaConfig()->cachePath, 'ormMetadata.php');
|
||||
|
||||
if (!file_exists($espoMetadataFile)) {
|
||||
$this->getConverter()->process();
|
||||
@@ -216,11 +216,11 @@ class Metadata
|
||||
return $this->espoMetadata;
|
||||
}
|
||||
|
||||
public function setEspoMetadata(array $espoMetadata)
|
||||
public function setOrmMetadata(array $espoMetadata)
|
||||
{
|
||||
$result = $this->getFileManager()->setContentPHP($espoMetadata, $this->getMetaConfig()->cachePath, 'espoMetadata.php');
|
||||
$result = $this->getFileManager()->setContentPHP($espoMetadata, $this->getMetaConfig()->cachePath, 'ormMetadata.php');
|
||||
if ($result == false) {
|
||||
$GLOBALS['log']->add('EXCEPTION', 'Metadata::setEspoMetadata() - Cannot save espoMetadata to a file');
|
||||
$GLOBALS['log']->add('EXCEPTION', 'Metadata::setOrmMetadata() - Cannot save ormMetadata to a file');
|
||||
throw new \Espo\Core\Exceptions\Error();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user