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