ecom
E-commerce cms
Main Page
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
core
models
CartProduct.php
Go to the documentation of this file.
1
<?php
2
3
namespace
Entity
;
4
5
class
CartProduct
extends
ModelBase
6
{
7
protected
function
install
()
8
{
9
$dbPrefix = $this->getDbPrefix();
10
$result = self::$dbo->exec(
"CREATE TABLE IF NOT EXISTS `{$dbPrefix}cart_product` (
11
`cart_id` INTEGER(11) UNSIGNED NOT NULL,
12
`product_id` INTEGER(11) UNSIGNED NULL,
13
`quantity` INTEGER(10) UNSIGNED NOT NULL,
14
FOREIGN KEY (`cart_id`) REFERENCES `{$dbPrefix}cart`(id),
15
FOREIGN KEY (`product_id`) REFERENCES `{$dbPrefix}product`(id),
16
UNIQUE(`cart_id`, `product_id`)
17
)"
);
18
if
($result ===
false
)
19
throw
new \Exception(get_class().
": "
.self::$dbo->errorInfo()[2]);
20
return
true
;
21
}
22
}
23
Entity
Definition:
Address.php:3
Entity\CartProduct
Definition:
CartProduct.php:5
Entity\CartProduct\install
install()
Definition:
CartProduct.php:7
Entity\ModelBase
Definition:
ModelBase.php:5
Generated on Sun Aug 16 2015 21:56:15 for ecom by
1.8.8