All Data Structures Namespaces Files Functions Variables
ModuleHook.php
Go to the documentation of this file.
<?php
namespace Entity;
class ModuleHook extends ModelBase
{
protected function install()
{
$dbPrefix = $this->getDbPrefix();
$result = self::$dbo->exec("CREATE TABLE IF NOT EXISTS `{$dbPrefix}modulehook` (
`id` INTEGER(11) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
`module_id` INTEGER(11) UNSIGNED NOT NULL,
`hookName` VARCHAR(32) NOT NULL,
`hookPosition` INTEGER(11) NOT NULL,
FOREIGN KEY (`module_id`) REFERENCES `{$dbPrefix}module`(id),
UNIQUE(`module_id`, `hookName`)
)");
if ($result === false)
throw new \Exception(get_class().": ".self::$dbo->errorInfo()[2]);
return true;
}
public static function getModules($moduleIds)
{
$fetcher = new self();
return $fetcher->selects(array("module_id" => $moduleIds), array("hookName", "hookPosition"));
}
}
Entity\ModuleHook
Definition: ModuleHook.php:5
Entity\ModuleHook\getModules
static getModules($moduleIds)
Definition: ModuleHook.php:23
Entity
Definition: Address.php:3
Entity\ModuleHook\install
install()
Definition: ModuleHook.php:7
Entity\ModelBase
Definition: ModelBase.php:5