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

## Protected Member Functions

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

## Private Member Functions

| createRoute ($category, $controller, $order)

## 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 Cms.php.

## Member Function Documentation

createRoute | ( |  | $category,
|  |  | $controller,
|  |  | $order
| ) |  |

private

Definition at line 26 of file Cms.php.

{
$cms = new self();
$cms->shurl = $category;
$cms->controller = $controller;
$cms->order = $order;
$cms->save();
}

install | ( |  | ) |

protected

Definition at line 7 of file Cms.php.

{
$dbPrefix = $this->getDbPrefix();
$result = self::$dbo->exec("CREATE TABLE IF NOT EXISTS `{$dbPrefix}cms` (
`id` INTEGER(11) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
`shurl` VARCHAR(255) NOT NULL,
`controller` VARCHAR(255) NOT NULL,
`order` INTEGER UNSIGNED NOT NULL DEFAULT 0,
UNIQUE(`shurl`)
)");
if ($result === false)
throw new \Exception(get_class().": ".self::$dbo->errorInfo()[2]);
self::createRoute("/", "\\Controller\\HomeController", 50);
self::createRoute("/:category", "\\Controller\\CategoryController", 50);
self::createRoute("/:category/:product", "\\Controller\\ProductController", 50);
self::createRoute("/:product", "\\Controller\\ProductController", 60);
return true;
}
Entity\ModelBase\getDbPrefix
static getDbPrefix()
Definition: ModelBase.php:42

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

- core/models/Cms.php