Skip to content

Commit

Permalink
マスタデータのEntityを拡張すると、マスタデータ管理ページでテーブルを選択できなくなる問題の対策
Browse files Browse the repository at this point in the history
  • Loading branch information
kztomita committed Jun 20, 2022
1 parent 6c466ad commit 53fd424
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/Eccube/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,17 @@ public function getAllClassNames()
$sourceFile = str_replace('\\', '/', $sourceFile);
$projectDir = str_replace('\\', '/', $projectDir);
}
// Replace /path/to/ec-cube to proxies path
$proxyFile = str_replace($projectDir, $this->trait_proxies_directory, $path).'/'.basename($sourceFile);
if (file_exists($proxyFile)) {

$entityPath = $projectDir . '/src/Eccube/Entity/';
$proxyFile = null;
if (strpos($sourceFile, $entityPath) === 0) {
// Entity class
$entityClass = substr($sourceFile, strlen($entityPath));
// Replace /path/to/ec-cube to proxies path
$proxyFile = str_replace($projectDir, $this->trait_proxies_directory, $path).'/'.$entityClass;
}

if ($proxyFile !== null && file_exists($proxyFile)) {
require_once $proxyFile;

$sourceFile = $proxyFile;
Expand Down

0 comments on commit 53fd424

Please sign in to comment.