Skip to content

Commit

Permalink
Add Function checkPluginCoreEntriesExist($plugin_title) to Helper
Browse files Browse the repository at this point in the history
  • Loading branch information
aljawaid committed Jul 22, 2023
1 parent 959577b commit 1f3ae2b
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions Helper/PluginCleaningHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
}
}
}
}
}

0 comments on commit 1f3ae2b

Please sign in to comment.