Skip to content

Commit 0143ca0

Browse files
committed
Product Generator was missing a function into class template
1 parent ef1e7f3 commit 0143ca0

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

app/base/commands/Generate/Product.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ class Product extends CodeGeneratorCommand
3131
{
3232
public const BASE_MODEL_NAMESPACE = "App\\Site\\Models\\";
3333
public const BASE_MIGRATION_NAMESPACE = "App\\Site\\Migrations\\";
34+
public const BASE_PRODUCT_INTERFACE = 'App\Base\Interfaces\Model\ProductInterface';
35+
public const PHYSICAL_PRODUCT_INTERFACE = 'App\Base\Interfaces\Model\PhysicalProductInterface';
3436

3537
/**
3638
* @var array columns
@@ -185,7 +187,7 @@ class Product extends CodeGeneratorCommand
185187
],
186188
];
187189

188-
protected $interface = 'App\Base\Interfaces\Model\ProductInterface';
190+
protected $interface = self::BASE_PRODUCT_INTERFACE;
189191
protected $traits = ['App\Base\Traits\ProductTrait'];
190192

191193
/**
@@ -395,6 +397,16 @@ class " . $className . " extends FrontendModel implements ".$this->getUtils()->g
395397
{
396398
use ".implode(";\n use ", array_map(fn($t) => $this->getUtils()->getClassBasename($t), $this->traits)).";
397399
400+
/**
401+
* {@inheritdoc}
402+
*
403+
* @return bool
404+
*/
405+
public function isPhysical(): bool
406+
{
407+
return " . ($this->interface == self::PHYSICAL_PRODUCT_INTERFACE ? 'true' : 'false') . ";
408+
}
409+
398410
/**
399411
* {@inheritdoc}
400412
*

0 commit comments

Comments
 (0)