CSY2028-assignment-2/jobs/Entity/Job.php

28 lines
690 B
PHP
Raw Normal View History

2023-01-23 14:37:07 +00:00
<?php
namespace jobs\Entity;
class Job {
public $id;
2023-01-23 16:08:38 +00:00
public $title;
2023-01-23 14:37:07 +00:00
public $description;
public $salary;
public $closingDate;
public $location;
public $categoryId;
2023-01-25 15:36:45 +00:00
public $clientId;
2023-01-23 14:37:07 +00:00
private $catsTable;
2023-02-05 12:07:01 +00:00
private $appsTable;
2023-01-23 14:37:07 +00:00
2023-02-05 12:07:01 +00:00
public function __construct(\jobs\JobDatabaseTable $catsTable, \jobs\JobDatabaseTable $appsTable) {
2023-01-23 14:37:07 +00:00
$this->catsTable = $catsTable;
2023-02-05 12:07:01 +00:00
$this->appsTable = $appsTable;
2023-01-23 14:37:07 +00:00
}
public function getCat() {
2023-02-04 22:19:29 +00:00
return $this->catsTable->find(['id'], ['value0' => $this->categoryId])[0];
2023-01-23 14:37:07 +00:00
}
2023-02-05 12:07:01 +00:00
public function getApps() {
return $this->appsTable->find(['jobId'], ['value0' => $this->id]);
}
2023-01-25 17:14:23 +00:00
}
?>