public static function GetAndStoreTaskLocations($caller, $sessionTask) { $sessionTasks = $caller->user()->getAttribute(\Library\Enums\SessionKeys::SessionTasks); $taskLocation = new \Applications\PMTool\Models\Dao\Task_location(); $taskLocation->setTask_id($sessionTask[\Library\Enums\SessionKeys::TaskObj]->task_id()); // if (!(count($sessionTask[\Library\Enums\SessionKeys::TaskLocations]) > 0)) { $dal = $caller->managers()->getManagerOf("TaskLocation"); $sessionTask[\Library\Enums\SessionKeys::TaskLocations] = $dal->selectMany($taskLocation, "task_id"); // } TaskHelper::SetSessionTask($caller->user(), $sessionTask); TaskHelper::SetCurrentSessionTask($caller->user(), $sessionTask); return self::GetLocationsFromTaskLocations($caller->user(), $sessionTask); }
public static function getLabServicesForTask($caller, $sessionTask, $filterCategory) { $labServices = $taskServices = array(); if (isset($sessionTask[\Library\Enums\SessionKeys::TaskServices]) && count($sessionTask[\Library\Enums\SessionKeys::TaskServices]) > 0) { $taskServices = \Applications\PMTool\Helpers\ServiceHelper::GetServicesFromTaskServices($caller->user(), $sessionTask); } else { $taskServices = ServiceHelper::GetAndStoreTaskServices($caller, $sessionTask); $sessionTask[\Library\Enums\SessionKeys::TaskServices] = $taskServices; TaskHelper::SetSessionTask($caller->user(), $sessionTask); } foreach ($taskServices as $service) { if ($service['service_type'] === $filterCategory) { array_push($labServices, $service); } } return $labServices; }