Skip to content

Commit

Permalink
implement rex_template::exists($id) (#5419)
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Nov 16, 2022
1 parent 0473cac commit c42654a
Showing 1 changed file with 7 additions and 0 deletions.
Expand Up @@ -289,4 +289,11 @@ public static function templateIsInUse(int $templateId, string $msgKey)

return $error;
}

public static function exists(int $templateId): bool
{
$sql = rex_sql::factory();
$sql->setQuery('SELECT 1 FROM '.rex::getTable('template').' WHERE id = ?', [$templateId]);
return 1 === $sql->getRows();
}
}

0 comments on commit c42654a

Please sign in to comment.