本文整理汇总了PHP中Tab::getCollectionFromModule方法的典型用法代码示例。如果您正苦于以下问题:PHP Tab::getCollectionFromModule方法的具体用法?PHP Tab::getCollectionFromModule怎么用?PHP Tab::getCollectionFromModule使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tab
的用法示例。
在下文中一共展示了Tab::getCollectionFromModule方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: uninstall
/**
* @see Module::uninstall()
*/
public function uninstall()
{
// Uninstall Tabs
$moduleTabs = Tab::getCollectionFromModule($this->name);
if (!empty($moduleTabs)) {
foreach ($moduleTabs as $moduleTab) {
$moduleTab->delete();
}
}
if (!parent::uninstall() || !$this->deleteTables()) {
return false;
}
return true;
}
示例2: deleteAdminTabs
/**
* Function to delete admin tabs from a menu with the module name
* @param string $name name of the module to delete
* @return bool
*/
public static function deleteAdminTabs($name)
{
// Get collection from module if tab exists
$tabs = Tab::getCollectionFromModule($name);
// Initialize result
$result = true;
// Check tabs
if ($tabs && count($tabs)) {
// Loop tabs for delete
foreach ($tabs as $tab) {
$result &= $tab->delete();
}
}
return $result;
}
示例3: disablingForModule
/**
* Disabling tabs for module
* @static
* @param $module string Module name
* @return bool Status
*/
public static function disablingForModule($module)
{
$tabs = Tab::getCollectionFromModule($module);
if (!empty($tabs)) {
foreach ($tabs as $tab) {
$tab->active = 0;
$tab->save();
}
return true;
}
return false;
}
示例4: uninstall
public function uninstall()
{
// Uninstall SQL
$sql = array();
include dirname(__FILE__) . '/sql/uninstall.php';
foreach ($sql as $s) {
if (!Db::getInstance()->execute($s)) {
return false;
}
}
Configuration::deleteByName('EXAMPLE_CONF');
// Uninstall Tabs
$moduleTabs = Tab::getCollectionFromModule($this->name);
if (!empty($moduleTabs)) {
foreach ($moduleTabs as $moduleTab) {
$moduleTab->delete();
}
}
// Uninstall Module
if (!parent::uninstall()) {
return false;
}
// You don't need to call this one because uninstall do it for you
// !$this->unregisterHook('actionObjectExampleDataAddAfter')
return true;
}