private function car(array $fields) { if (!isset($fields['productId']) || !array_key_exists($fields['productId'], $this->products)) { throw new \Exception('Fake ORM car id not found'); } return RepositoryFactory::get('car', ['price' => $this->products[$fields['productId']]['price']]); }