ecom
E-commerce cms
 All Data Structures Namespaces Files Functions Variables
ModuleHook.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Entity;
4 
5 class ModuleHook extends ModelBase
6 {
7  protected function install()
8  {
9  $dbPrefix = $this->getDbPrefix();
10  $result = self::$dbo->exec("CREATE TABLE IF NOT EXISTS `{$dbPrefix}modulehook` (
11  `id` INTEGER(11) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
12  `module_id` INTEGER(11) UNSIGNED NOT NULL,
13  `hookName` VARCHAR(32) NOT NULL,
14  `hookPosition` INTEGER(11) NOT NULL,
15  FOREIGN KEY (`module_id`) REFERENCES `{$dbPrefix}module`(id),
16  UNIQUE(`module_id`, `hookName`)
17  )");
18  if ($result === false)
19  throw new \Exception(get_class().": ".self::$dbo->errorInfo()[2]);
20  return true;
21  }
22 
23  public static function getModules($moduleIds)
24  {
25  $fetcher = new self();
26  return $fetcher->selects(array("module_id" => $moduleIds), array("hookName", "hookPosition"));
27  }
28 }
29 
static getModules($moduleIds)
Definition: ModuleHook.php:23