diff --git a/src/App.php b/src/App.php index 0fb65d532a..cc276b6a9b 100644 --- a/src/App.php +++ b/src/App.php @@ -61,8 +61,6 @@ class App 'videoheight' => 350, ]; - private $queue = []; - /** * @var Mode The Mode of the Application */ @@ -205,33 +203,39 @@ class App /** * Set workerqueue information * + * @deprecated 2024.12 Use AppHelper::setQueue() instead + * * @param array $queue * @return void */ public function setQueue(array $queue) { - $this->queue = $queue; + $this->appHelper->setQueue($queue); } /** * Fetch workerqueue information * + * @deprecated 2024.12 Use AppHelper::getQueue() instead + * * @return array Worker queue */ public function getQueue(): array { - return $this->queue ?? []; + return $this->appHelper->getQueue(); } /** * Fetch a specific workerqueue field * + * @deprecated 2024.12 Use AppHelper::getQueueValue() instead + * * @param string $index Work queue record to fetch * @return mixed Work queue item or NULL if not found */ public function getQueueValue(string $index) { - return $this->queue[$index] ?? null; + return $this->appHelper->getQueueValue($index); } public function setThemeInfoValue(string $index, $value) diff --git a/src/AppHelper.php b/src/AppHelper.php index 45a71dc6b2..eb9a1aa07c 100644 --- a/src/AppHelper.php +++ b/src/AppHelper.php @@ -28,6 +28,8 @@ final class AppHelper private $contact_id = 0; + private $queue = []; + /** * Set the profile owner ID */ @@ -79,4 +81,36 @@ final class AppHelper { return $this->contact_id; } + + /** + * Set workerqueue information + * + * @param array $queue + */ + public function setQueue(array $queue): void + { + $this->queue = $queue; + } + + /** + * Fetch workerqueue information + * + * @return array Worker queue + */ + public function getQueue(): array + { + return $this->queue; + } + + /** + * Fetch a specific workerqueue field + * + * @param string $index Work queue record to fetch + * + * @return mixed|null Work queue item or NULL if not found + */ + public function getQueueValue(string $index) + { + return $this->queue[$index] ?? null; + } }