public function getEntity(int $entityId) { return isset($this->entities[$entityId]) ? $this->entities[$entityId] : null; }