diff --git a/Helper/PluginCleaningHelper.php b/Helper/PluginCleaningHelper.php index ebc9779..141f51f 100644 --- a/Helper/PluginCleaningHelper.php +++ b/Helper/PluginCleaningHelper.php @@ -131,4 +131,33 @@ public function checkPluginCoreColumnsExist($plugin_title) } } } + + /** + * Check if The Plugin Core Database Entries Exist + * + * @var $plugin_title + * @return bool + * @author aljawaid + */ + public function checkPluginCoreEntriesExist($plugin_title) + { + foreach ($this->helper->pluginCleaningHelper->getDeletablePlugins() as $plugin) { + if (($plugin['plugin_title'] == $plugin_title) && isset($plugin['core_table_entries'])) { + foreach ($plugin['core_table_entries'] as $tables) { + foreach ($tables as $tablename => $tablecolumns) { + $db_result = $this->applicationCleaningModel->getColumns($tablename); + foreach ($tablecolumns as $column => $row) { + if ($this->db->table($tablename)->eq($column, $row)->exists()) { + //return t('Entries Exist'); + return true; + } else { + //return t('Entries Don\'t Exist'); + return false; + } + } + } + } + } + } + } }