blockId = $blockId; } public function getBodyVariables() { $vars = parent::getBodyVariables(); $vars['block'] = $this->getBlock($this->blockId); return $vars; } private function getBlock($id) { $block = sqlQueryBuilder()->select('b.*') ->from('blocks', 'b') ->where(Translation::coalesceTranslatedFields(BlocksTranslation::class)) ->andWhere(Operator::equals(['b.id' => $id])) ->execute()->fetch(); if (!$block) { throw new NotFoundHttpException('Block was not found'); } return $block; } }