refactored

This commit is contained in:
Joshua Perry 2023-02-05 12:07:01 +00:00
parent e4ea23f71f
commit 881a554a49
1 changed files with 7 additions and 1 deletions

View File

@ -10,13 +10,19 @@ class Job {
public $categoryId; public $categoryId;
public $clientId; public $clientId;
private $catsTable; private $catsTable;
private $appsTable;
public function __construct(\jobs\JobDatabaseTable $catsTable) { public function __construct(\jobs\JobDatabaseTable $catsTable, \jobs\JobDatabaseTable $appsTable) {
$this->catsTable = $catsTable; $this->catsTable = $catsTable;
$this->appsTable = $appsTable;
} }
public function getCat() { public function getCat() {
return $this->catsTable->find(['id'], ['value0' => $this->categoryId])[0]; return $this->catsTable->find(['id'], ['value0' => $this->categoryId])[0];
} }
public function getApps() {
return $this->appsTable->find(['jobId'], ['value0' => $this->id]);
}
} }
?> ?>