public function getEntityById($id) { if (!array_key_exists($id, $this->entities)) { $this->hydrateEntity($id); } return $this->entities[$id]; }