Added entities

This commit is contained in:
Joshua Perry 2023-01-23 14:37:07 +00:00
parent 412ccfd4fd
commit d8fa24e186
3 changed files with 46 additions and 0 deletions

20
jobs/Entity/Applicant.php Normal file
View File

@ -0,0 +1,20 @@
<?php
namespace jobs\Entity;
class Applicant {
public $id;
public $name;
public $email;
public $details;
public $cv;
public $jobId;
private $jobsTable;
public function __construct(\CSY2028\DatabaseTable $jobsTable) {
$this->jobsTable = $jobsTable;
}
public function getJob() {
return $this->jobsTable->find('id', $this->jobId)[0];
}
}
?>

7
jobs/Entity/Category.php Normal file
View File

@ -0,0 +1,7 @@
<?php
namespace jobs\Entity;
class Category {
public $id;
public $name;
}
?>

19
jobs/Entity/Job.php Normal file
View File

@ -0,0 +1,19 @@
<?php
namespace jobs\Entity;
class Job {
public $id;
public $description;
public $salary;
public $closingDate;
public $location;
public $categoryId;
private $catsTable;
public function __construct(\CSY2028\DatabaseTable $catsTable) {
$this->catsTable = $catsTable;
}
public function getCat() {
return $this->catsTable->find('id', $this->categoryId);
}
}