<?php

namespace App\Services;

use App\Core\Database;

class HomepageOrchestratorService
{

public static function enqueue(
int $conferenceId,
string $type,
int $userId
)
{

$db=
Database::getInstance();

return
$db
->prepare("

INSERT INTO
conference_home_jobs(

conference_id,

job_type,

created_by

)

VALUES(

?,

?,

?

)

")

->execute([

$conferenceId,

$type,

$userId

]);

}

public static function latest(
int $conferenceId
)
{

$db=
Database::getInstance();

$stmt=
$db
->prepare("

SELECT *

FROM
conference_home_jobs

WHERE conference_id=?

ORDER BY id DESC

LIMIT 1

");

$stmt
->execute([

$conferenceId

]);

return
$stmt
->fetch()

??

[];

}

}
