wip: 2026-02-14T02:50:05+0100 (1771033805)

This commit is contained in:
Victor Westerlund 2026-02-14 02:50:05 +01:00
parent d8cebde6a4
commit 97b48aaf52
Signed by: vlw
GPG key ID: D0AD730E1057DFC6

View file

@ -23,10 +23,10 @@
* @param string $name
* @return static|null
*/
public static function from_name(string $name): ?static {
public static function from_name(string $name, bool $slugify = true): ?static {
$query = Database::current()
->from(Database::get_table(Posts::TABLE_NAME))
->where([Posts::POST_NAME->value => slugify($name)])
->where([Posts::POST_NAME->value => $slugify ? slugify($name) : $name])
->limit(1)
->select(Posts::ID->value);