File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
app/base/commands/Generate Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff 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 *
You can’t perform that action at this time.
0 commit comments