public function getSnippetById($id, $show = 'enabled', $template = true) { if (!is_numeric($id)) { throw new \InvalidArgumentException("ID is not numeric: " . $id); } $queryBuilder = $this->getSnippetQueryBuilder($show, $template)->andWhere('snippet.id = :id')->setParameter('id', $id); $result = $queryBuilder->getQuery()->getOneOrNullResult(); return $this->checkIfSnippetIsDisabled($queryBuilder, $result, $show); }