Skip to content

Commit

Permalink
Merge pull request #5 from phcorp/master
Browse files Browse the repository at this point in the history
fix columns names duplicates
  • Loading branch information
phcorp authored Mar 20, 2017
2 parents 7785a9f + b4ea9ab commit 96a6096
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Command/DoctrinevizCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,14 @@ public function execute(InputInterface $input, OutputInterface $output)
$to = $graph->getVertex($tables[$targetEntity]->getId())->getRecord(array_values($columns)[0]);
if (!$to) {
$to = new Record($this->getFieldMappingDisplayName([
'fieldName' => array_values($columns)[0],
'columnName' => array_values($columns)[0],
]));
$tables[$targetEntity]->addRecord($to);
}
$from = $graph->getVertex($tables[$entity]->getId())->getRecord(array_keys($columns)[0]);
if (!$from) {
$from = new Record($this->getFieldMappingDisplayName([
'fieldName' => array_keys($columns)[0],
'columnName' => array_keys($columns)[0],
]));
$tables[$entity]->addRecord($from);
}
Expand Down Expand Up @@ -193,7 +193,7 @@ protected function getCardinality(array $fieldMapping)
*
* @return string
*/
protected function getFieldMappingDisplayName(array $fieldMapping, $nameKey = 'fieldName')
protected function getFieldMappingDisplayName(array $fieldMapping, $nameKey = 'columnName')
{
$name = $fieldMapping[$nameKey];
$type = array_key_exists('type', $fieldMapping) ? $fieldMapping['type'] : 'integer';
Expand Down
6 changes: 6 additions & 0 deletions test/Entity/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,14 @@ class User
*/
protected $lastName;

/**
* @ORM\Column(name="email_id", type="integer")
*/
protected $idEmail;

/**
* @ORM\OneToOne(targetEntity="Email")
* @ORM\JoinColumn(name="email_id", referencedColumnName="id")
*/
protected $email;

Expand Down

0 comments on commit 96a6096

Please sign in to comment.