ecom
E-commerce cms
 All Data Structures Namespaces Files Functions Variables Pages
Protected Member Functions
Category Class Reference
Inheritance diagram for Category:
ModelBase

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 ()
 
 selects ($criteria=null, $orderBy=null)
 
 selectById ($id)
 
- Static Public Member Functions inherited from ModelBase
static init ()
 
static getDbPrefix ()
 
static setup ()
 
- Static Protected Attributes inherited from ModelBase
static $dbo = null
 

Detailed Description

Definition at line 5 of file Category.php.

Member Function Documentation

install ( )
protected

Definition at line 7 of file Category.php.

8  {
9  $dbPrefix = $this->getDbPrefix();
10  $result = self::$dbo->exec("CREATE TABLE IF NOT EXISTS `{$dbPrefix}category` (
11  `id` INTEGER(11) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
12  `parent_id` INTEGER(11) UNSIGNED NULL,
13  FOREIGN KEY (`parent_id`) REFERENCES `{$dbPrefix}category`(id)
14  )");
15  if ($result === false)
16  throw new \Exception(get_class().": ".self::$dbo->errorInfo()[2]);
17  return true;
18  }
static getDbPrefix()
Definition: ModelBase.php:34

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