1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 01:39:24 +02:00

Add Calendar

This commit is contained in:
Daniel Neto 2024-05-03 12:16:27 -03:00
parent be8ebd1227
commit 47a4532d0b
1165 changed files with 156626 additions and 11163 deletions

View file

@ -1058,6 +1058,20 @@ abstract class ObjectYPT implements ObjectInterface
$obj->properties = $state['properties'];
return $obj;
}
static function isTableEmpty()
{
$sql = "SELECT 1 FROM `" . static::getTableName() . "` LIMIT 1";
$res = sqlDAL::readSql($sql);
if ($res) {
$row = sqlDAL::fetchAssoc($res);
sqlDAL::close($res);
return $row ? false : true; // Return false if a row exists (table is not empty), true if no row exists (table is empty)
} else {
return true; // Assume the table is empty if the query fails
}
}
}
abstract class CacheHandler {