# ecom: core/models/Product.php Source File

All Data Structures Namespaces Files Functions Variables
Product.php
Go to the documentation of this file.
<?php
namespace Entity;
class Product extends ModelBase
{
protected function install()
{
$dbPrefix = $this->getDbPrefix();
$result = self::$dbo->exec("CREATE TABLE IF NOT EXISTS `{$dbPrefix}product` (
`id` INTEGER(11) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
`parent` INTEGER(11) UNSIGNED NULL,
`shurl` VARCHAR(255) NOT NULL,
`priceExcl` FLOAT NULL,
`priceIncl` FLOAT NULL,
`ean` VARCHAR(64) NULL,
FOREIGN KEY (`parent`) REFERENCES `{$dbPrefix}product`(id)
)");
if ($result === false)
throw new \Exception(get_class().": ".self::$dbo->errorInfo()[2]);
return true;
}
}
Entity\Product\install
install()
Definition: Product.php:7
Entity
Definition: Address.php:3
Entity\Product
Definition: Product.php:5
Entity\ModelBase
Definition: ModelBase.php:5