Return an integer when checking time ID by stored rewrite
This commit is contained in:
parent
09518a0a6e
commit
3c43a3f2d3
|
@ -711,11 +711,11 @@ final class NodaIDGetter {
|
||||||
* @param string $lang Language to check in.
|
* @param string $lang Language to check in.
|
||||||
* @param string $name Name of the time to search for.
|
* @param string $name Name of the time to search for.
|
||||||
*
|
*
|
||||||
* @return array<integer>
|
* @return integer
|
||||||
*/
|
*/
|
||||||
public static function getTimeIDByRewrite(MDMysqli $mysqli_noda, string $lang, string $name):array {
|
public static function getTimeIDByRewrite(MDMysqli $mysqli_noda, string $lang, string $name):int {
|
||||||
|
|
||||||
if (empty($name)) return [];
|
if (empty($name)) return 0;
|
||||||
|
|
||||||
$output = [];
|
$output = [];
|
||||||
|
|
||||||
|
@ -725,9 +725,10 @@ final class NodaIDGetter {
|
||||||
WHERE `language` = ?
|
WHERE `language` = ?
|
||||||
AND `input_name` = ?", "ss", $lang, $name);
|
AND `input_name` = ?", "ss", $lang, $name);
|
||||||
|
|
||||||
while ($timeRewriteData = $timeRewriteResult->fetch_row()) {
|
if ($timeRewriteData = $timeRewriteResult->fetch_row()) {
|
||||||
$output[] = $timeRewriteData[0];
|
$output = (int)$timeRewriteData[0];
|
||||||
}
|
}
|
||||||
|
else $output = 0;
|
||||||
|
|
||||||
$timeRewriteResult->close();
|
$timeRewriteResult->close();
|
||||||
|
|
||||||
|
@ -943,7 +944,7 @@ final class NodaIDGetter {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($timeIdByRewrite = self::getTimeIDByRewrite($mysqli_noda, $lang, $name))) {
|
if (!empty($timeIdByRewrite = self::getTimeIDByRewrite($mysqli_noda, $lang, $name))) {
|
||||||
return end($timeIdByRewrite);
|
return $timeIdByRewrite;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($instance !== "") {
|
if ($instance !== "") {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user