本文整理匯總了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;
}