All Data Structures Namespaces Files Functions Variables
CartProduct Class Reference
Inheritance diagram for CartProduct:

## Protected Member Functions

| install ()
Protected Member Functions inherited from ModelBase
| install ()

## Additional Inherited Members

Public Member Functions inherited from ModelBase
| __construct ($id=null)
| getTableName ()
| getMeta ($lang=null)
| __get ($key)
| __set ($key, $value)
| save ()
| delete ()
| selects ($criteria=null, $orderBy=null)
| selectById ($id)
Static Public Member Functions inherited from ModelBase
static | init ($config=null)
static | getDbPrefix ()
static | setup ()
Static Protected Attributes inherited from ModelBase
static | $dbo = null

## Detailed Description

Definition at line 5 of file CartProduct.php.

## Member Function Documentation

install | ( |  | ) |

protected

Definition at line 7 of file CartProduct.php.

{
$dbPrefix = $this->getDbPrefix();
$result = self::$dbo->exec("CREATE TABLE IF NOT EXISTS `{$dbPrefix}cart_product` (
`cart_id` INTEGER(11) UNSIGNED NOT NULL,
`product_id` INTEGER(11) UNSIGNED NULL,
`quantity` INTEGER(10) UNSIGNED NOT NULL,
FOREIGN KEY (`cart_id`) REFERENCES `{$dbPrefix}cart`(id),
FOREIGN KEY (`product_id`) REFERENCES `{$dbPrefix}product`(id),
UNIQUE(`cart_id`, `product_id`)
)");
if ($result === false)
throw new \Exception(get_class().": ".self::$dbo->errorInfo()[2]);
return true;
}
Entity\ModelBase\getDbPrefix
static getDbPrefix()
Definition: ModelBase.php:42

The documentation for this class was generated from the following file:

- core/models/CartProduct.php