id = $id; $company = $this->baseRequest('employers/' . $id)->get(); $this->company = $company; } } public function getName() { return $this->company->name; } public function getDescription() { return $this->company->description; } public function getJobs() { $j = $this->baseRequest('vacancies')->addParams(['employer_id' => $this->id])->get(); if($j){ foreach ($j->items as $item){ $this->jobs[] = new Vacancy($item); } } return $this->jobs; } }