/** * @param $id * @param string $instanceIdentifier * @return Company * @throws \ErrorException */ public static function loadById($id, $instanceIdentifier = '') { $result = Request::get('/companies/info/' . $id . '.json', false); if (!empty($result->error)) { Error::exception($result->setFlash[0]->msg); } $company = new self($result->company, $instanceIdentifier); $company->getWorkers(); return $company; }