returnJson($this->getPicRegistry()->getLatestRuntimes()); } catch (PortableElementException $e) { $this->returnJson($e->getMessage(), 500); } } /** * @return PortableElementRegistry */ protected function getPicRegistry() { if (! $this->registry) { $this->registry = (new PicModel())->getRegistry(); } return $this->registry; } }