getContainer()->get('layout')->get($params['scope'], $params['name']); if (empty($data)) { throw new NotFound("Layout " . $params['scope'] . ":" . $params['name'] . ' is not found'); } return $data; } public function actionUpdate($params, $data) { if (!$this->getUser()->isAdmin()) { throw new Forbidden(); } $result = $this->getContainer()->get('layout')->set($data, $params['scope'], $params['name']); if ($result === false) { throw new Error("Error while saving layout"); } $this->getContainer()->get('dataManager')->updateCacheTimestamp(); return $this->getContainer()->get('layout')->get($params['scope'], $params['name']); } public function actionPatch($params, $data) { return $this->actionUpdate($params, $data); } }