ecom
E-commerce cms
Main Page
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
core
models
Address.php
Go to the documentation of this file.
1
<?php
2
3
namespace
Entity
;
4
5
class
Address
extends
ModelBase
6
{
7
protected
function
install
()
8
{
9
$dbPrefix = $this->getDbPrefix();
10
$result = self::$dbo->exec(
"CREATE TABLE IF NOT EXISTS `{$dbPrefix}address` (
11
`id` INTEGER(11) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
12
`user_id` INTEGER(11) UNSIGNED NULL,
13
`addressName` VARCHAR(255) NOT NULL,
14
`fullName` VARCHAR(255) NOT NULL,
15
`streetAddress` TEXT NOT NULL,
16
`city` VARCHAR(128) NOT NULL,
17
`zipCode` VARCHAR(16) NOT NULL,
18
`country` VARCHAR(128) NOT NULL,
19
`lastUsed` DATETIME NOT NULL,
20
FOREIGN KEY (`user_id`) REFERENCES `{$dbPrefix}user`(id),
21
UNIQUE(`user_id`, `addressName`)
22
)"
);
23
if
($result ===
false
)
24
throw
new \Exception(get_class().
": "
.self::$dbo->errorInfo()[2]);
25
return
true
;
26
}
27
}
28
Entity
Definition:
Address.php:3
Entity\Address\install
install()
Definition:
Address.php:7
Entity\Address
Definition:
Address.php:5
Entity\ModelBase
Definition:
ModelBase.php:5
Generated on Sun Aug 16 2015 15:52:07 for ecom by
1.8.8