mirror of
https://github.com/maxpozdeev/mytinytodo.git
synced 2026-03-11 08:55:27 +00:00
rename DBCore::defaultInstance()
This commit is contained in:
parent
8815569861
commit
a41eae1ea7
5 changed files with 6 additions and 6 deletions
|
|
@ -24,7 +24,7 @@ if (!$listData) {
|
|||
die("No list found.");
|
||||
}
|
||||
|
||||
$data = DBCore::defaultInstance()->getTasksByListId($listId, '', (int)$listData['sorting']);
|
||||
$data = DBCore::default()->getTasksByListId($listId, '', (int)$listData['sorting']);
|
||||
|
||||
if (_get('format') == 'ical') {
|
||||
printICal($listData, $data);
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ printRss($data, $listData);
|
|||
|
||||
function fillData(array &$data, int $listId, string $field, string $sqlWhere )
|
||||
{
|
||||
$tasks = DBCore::defaultInstance()->getTasksByListId($listId, $sqlWhere, "$field DESC", 100);
|
||||
$tasks = DBCore::default()->getTasksByListId($listId, $sqlWhere, "$field DESC", 100);
|
||||
$lang = Lang::instance();
|
||||
foreach ($tasks as $r)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@ class TasksController extends ApiController {
|
|||
checkWriteAccess();
|
||||
$id = (int)$id;
|
||||
|
||||
if (!DBCore::defaultInstance()->taskExists($id)) {
|
||||
if (!DBCore::default()->taskExists($id)) {
|
||||
$this->response->data = ['total' => 0];
|
||||
return;
|
||||
}
|
||||
|
|
@ -461,7 +461,7 @@ class TasksController extends ApiController {
|
|||
|
||||
private function getTaskRowById(int $id): ?array
|
||||
{
|
||||
$r = DBCore::defaultInstance()->getTaskById($id);
|
||||
$r = DBCore::default()->getTaskById($id);
|
||||
if (!$r) {
|
||||
throw new Exception("Failed to fetch task data");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ class DBCore
|
|||
* @return DBCore
|
||||
* @throws Exception
|
||||
*/
|
||||
public static function defaultInstance() : DBCore
|
||||
public static function default() : DBCore
|
||||
{
|
||||
if (!isset(self::$defaultInstance)) {
|
||||
throw new Exception("DBCore defaultInstance is not initialized");
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ function parseRoute($queryString)
|
|||
redirectWithHashRoute($hash, $q);
|
||||
}
|
||||
else if (isset($q['task'])) {
|
||||
$listId = (int)DBCore::defaultInstance()->getListIdByTaskId((int)$q['task']);
|
||||
$listId = (int)DBCore::default()->getListIdByTaskId((int)$q['task']);
|
||||
if ($listId > 0) {
|
||||
$h = [ 'list', $listId, 'search', '#'. (int)$q['task']];
|
||||
redirectWithHashRoute($h);
|
||||
|
|
|
|||
Loading…
Reference in a new issue