|null exactly one matching element, else null (reported) */
private function one($content, int $pid, string $where, string $label): ?array
{
$rows = $content->fetchAllAssociative(
'SELECT uid, header, hidden, sorting FROM tt_content WHERE deleted = 0 AND sys_language_uid IN (0,-1) AND pid = ? AND ' . $where,
[$pid]
);
return count($rows) === 1 ? $rows[0] : null;
}
private function p(string $text): string
{
return '' . htmlspecialchars($text, ENT_NOQUOTES | ENT_HTML5) . '
';
}
private function norm(string $value): string
{
return (string)preg_replace('/[^a-z0-9]+/', '', str_replace(['+', '&'], ['plus', 'and'], mb_strtolower($value)));
}
}