Updated database tables to include entities

This commit is contained in:
Joshua Perry 2023-01-23 14:37:23 +00:00
parent d8fa24e186
commit 018c046d85
2 changed files with 9 additions and 5 deletions

View File

@ -22,6 +22,10 @@ class EntryPoint {
list($controllerName, $functionName) = \explode('/', $route);
if ($functionName == '') {
$functionName = 'home';
}
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$functionName = $functionName . 'Submit';
}

View File

@ -2,19 +2,19 @@
namespace jobs;
class Routes implements \CSY2028\Routes {
public function getController($name) {
//TODO: Add Database Tables
//Remember entities
$jobsTable = new \CSY2028\DatabaseTable('jobs', 'id');
$catsTable = new \CSY2028\DatabaseTable('category', 'id', '\jobs\Entity\Category');
$jobsTable = new \CSY2028\DatabaseTable('jobs', 'id', '\jobs\Entity\Job', [$catsTable]);
$appsTable = new \CSY2028\DatabaseTable('applicants', 'id', '\jobs\Entity\Applicant', [$jobsTable]);
$controllers = [];
//TODO: Add Controllers
$controllers['home'] = new \jobs\controllers\Home($jobsTable);
$controllers['jobs'] = new \jobs\controllers\Jobs($jobsTable);
return $controllers[$name];
}
public function getDefaultRoute() {
return 'home/home';
return 'jobs/home';
}
public function checkLogin($route) {