Setup ID getter by rewrite for tags to return arrays
Tag rewrites can now be set for multiple target tags.
This commit is contained in:
parent
fce933c12a
commit
af454ec013
@ -241,23 +241,23 @@ final class NodaIDGetter {
|
||||
* @param string $lang Language to check in.
|
||||
* @param string $name Name of the tag to search for.
|
||||
*
|
||||
* @return integer
|
||||
* @return array<integer>
|
||||
*/
|
||||
public static function getTagIDByRewrite(MDMysqli $mysqli_noda, string $lang, string $name):int {
|
||||
public static function getTagIDByRewrite(MDMysqli $mysqli_noda, string $lang, string $name):array {
|
||||
|
||||
if (empty($name)) return 0;
|
||||
if (empty($name)) return [];
|
||||
|
||||
$output = [];
|
||||
|
||||
$tagRewriteResult = $mysqli_noda->query_by_stmt("
|
||||
SELECT `tag_id`
|
||||
FROM `tag_rewriting`
|
||||
WHERE `tag_language` = ?
|
||||
AND `input_name` = ?
|
||||
LIMIT 1", "ss", $lang, $name);
|
||||
AND `input_name` = ?", "ss", $lang, $name);
|
||||
|
||||
if ($tagRewriteData = $tagRewriteResult->fetch_row()) {
|
||||
$output = $tagRewriteData[0];
|
||||
while ($tagRewriteData = $tagRewriteResult->fetch_row()) {
|
||||
$output[] = $tagRewriteData[0];
|
||||
}
|
||||
else $output = 0;
|
||||
|
||||
$tagRewriteResult->close();
|
||||
$tagRewriteResult = null;
|
||||
|
Loading…
Reference in New Issue
Block a user