Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
scrs_zdenek committed Jan 31, 2024
1 parent 2403af7 commit f9d7e35
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/Drago/Generator/Generator/DataClassGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

use Dibi\Exception;
use Drago\Generator\Base;
use Drago\Utils\CaseConverter;
use Nette\PhpGenerator\ClassType;
use Nette\PhpGenerator\PhpFile;
use Nette\Utils\FileSystem;
Expand Down Expand Up @@ -86,8 +85,9 @@ public function createPhpFile(string $table): void

// Add constants.
if ($options->constantDataClass) {
$constant = $this->options->constantDataPrefix
? $this->inflector->classify($this->options->constantDataPrefix . $column)
$cp = $this->options->constantDataPrefix;
$constant = $cp
? $cp . $this->inflector->classify($column)
: $this->inflector->classify($column);

$class->addConstant($constant, $column)
Expand Down
6 changes: 3 additions & 3 deletions src/Drago/Generator/Generator/EntityGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

use Dibi\Exception;
use Drago\Generator\Base;
use Drago\Utils\CaseConverter;
use Nette\PhpGenerator\ClassType;
use Nette\PhpGenerator\PhpFile;
use Nette\Utils\FileSystem;
Expand Down Expand Up @@ -98,8 +97,9 @@ public function createPhpFile(string $table): void

// Add other constants.
if ($options->constant) {
$constant = $this->options->constantPrefix
? $this->inflector->classify($this->options->constantPrefix . $column)
$cp = $this->options->constantPrefix;
$constant = $cp
? $cp . $this->inflector->classify($column)
: $this->inflector->classify($column);

if (!$attr->isAutoIncrement()) {
Expand Down

0 comments on commit f9d7e35

Please sign in to comment.