2022-01-27 * @author Eric "The fingers on this keyboard" Schwarzer * */ require_once(__DIR__.'/ui.php'); $template->title = "Origins of the WordPress database table \"{$slug}\""; $createdByAddons = \AddonQuery::create() ->useAddonTableQuery() ->filterByName($slug) ->filterByState('active') ->endUse() ->orderByName() ->find(); if (!$createdByAddons->count()) { // not found in db \Util::Redirect('/', 307); } // for this one we want a list of addons where a table has been created and cleaned up properly. // eg. no dirty entry exists for the table. $createdByAddonsNoDirty = \AddonQuery::create() // where exists a table for this addon with name = slug and state = active ->useAddonTableQuery() ->filterByName($slug) ->filterByState('active') ->endUse() // and where NOT exists a table for this addon .. with state = dirty. // need this to exclude any addons that will come up in the dirty list below. ->useAddonTableNotExistsQuery() ->filterByName($slug) ->filterByState('dirty') ->endUse() ->orderByName() ->find(); $remainingByAddons = \AddonQuery::create() ->useAddonTableQuery() ->filterByName($slug) ->filterByState('dirty') ->endUse() ->orderByName() ->find(); $template->assign([ 'createdByAddons' => $createdByAddons, 'createdByAddonsNoDirty' => $createdByAddonsNoDirty, 'remainingByAddons' => $remainingByAddons ]); $template->display('reference/table.tpl');