Get current schedule

@return array schedule list
345592
public function getSchedule()
    {
        $list = [];

        foreach ($this->schedule as $time => $jobs) {
            foreach ($jobs as $job) {
                $list[$time][] = $job->getId();
            }
        }

        return $list;
    }
166939
public function getSchedule($date)
    {
        $weekend = array('Sat', 'Sun');
        $scheduleStart = '08:00:00';
        $scheduleEnd = '17:00:00';

        if(!$date) {
            $date = date('Y-m-d');
        }
        $startStr = $date . ' ' . $scheduleStart;
        $endStr = $date . ' ' . $scheduleEnd;
        $dateArr = explode('-', $date);
        $mk_time = mktime(0, 0, 0, $dateArr[1], $dateArr[2], $dateArr[0]);
        $day = date('D', $mk_time);

        $fhirSchedule = new FHIRSchedule();
        if(!in_array($day, $weekend)) {

            $planningHorizon =	new FHIRPeriod();
            $dateTimeStart = new FHIRDateTime();
            $dateTimeStart->setValue($startStr);
            $planningHorizon->setStart($dateTimeStart);
            $dateTimeEnd = new FHIRDateTime();
            $dateTimeEnd->setValue($endStr);
            $planningHorizon->setEnd($dateTimeEnd);
            $fhirSchedule->setPlanningHorizon($planningHorizon);
        }
        return $fhirSchedule;
    }
1146030
public static function getWeekdays() {
		return array(
			self::MONDAY,
			self::TUESDAY,
			self::WEDNESDAY,
			self::THURSDAY,
			self::FRIDAY,
			self::SATURDAY,
			self::SUNDAY,
		);
	}
1366875
public static Map<String, String> getSchedulerNames(){
		Map<String, String> schedulerNames = new HashMap<String, String>();
		MySchedule mySchedule = MySchedule.getInstance();
		for(String settingsName: mySchedule.getSchedulerSettingsNames()){
			SchedulerSettings settings = mySchedule.getSchedulerSettings(settingsName);
			schedulerNames.put(settingsName, settings.getSchedulerFullName());
		}
		return schedulerNames;
	}
539683
public function getCurrentTime()
    {
        $config = $this->config;
        $time = $config->time;
        if ($time !== null) {
            if ($config->timeChanging) {
                return $this->__call('time', []) + $time;
            }
            return $time;
        }
        return $this->__call('time', []);
    }
522470
public function listAction()
    {
        $calendars = $this->getDoctrine()
            ->getRepository('CanalTPMttBundle:Calendar')
            ->findBy(
                ['customer' => $this->getUser()->getCustomer()],
                ['id'=>'desc']
            );

        return $this->render('CanalTPMttBundle:Calendar:list.html.twig', [
          'no_left_menu' => true,
          'calendars'    => $calendars
        ]);
    }
914788
public function evaluateSchedule()
    {
        $this->scheduleModel->reset()
            ->setContactClient($this->contactClient)
            ->setTimezone()
            ->evaluateDay()
            ->evaluateTime()
            ->evaluateExclusions();

        return new \DateTime();
    }
124920
public function list() : String
    {
        $list = '';

        if( is_file($this->crontabCommands) )
        {
            $jobs  = $this->listArray();
            $list  = '<pre>';
            $list .= '[ID] CRON JOB<br><br>';

            foreach( $jobs as $key => $job )
            {
                $list .= '[' . $key . ']: '. $job . '<br>';
            }

            $list .= '</pre>';
        }

        return $list;
    }
430902
public function getStatuses()
    {
        $schedules = clone $this->getCollection()
            ->setOrder('status', Zend_Db_Select::SQL_ASC);
        $schedules->getSelect()
            ->group('status')
            ->reset(Zend_Db_Select::COLUMNS)
            ->columns('status');
        $statuses = $schedules->getConnection()
            ->fetchCol($schedules->getSelect());
        $statusArray = array();
        foreach ($statuses as $status) {
            $statusArray[$status] = $status;
        }
        return $statusArray;
    }
116662
public function calendarList()
    {

        $arr = $this->repository->scopeQuery(function ($query) {
            return $query->where('status', '!=', 'Draft');

        })->all();

        $temp = [];

        foreach ($arr as $key => $value) {

            $temp[$key]['id']        = $value->getRouteKey();
            $temp[$key]['title']     = $value['title'];
            $temp[$key]['start']     = date('Y-m-d H:i:s', strtotime($value['start']));
            $temp[$key]['end']       = date('Y-m-d H:i:s', strtotime($value['end']));
            $temp[$key]['className'] = $value['color'];
        }

        return json_encode($temp);
    }
1313121
public function getScheduled()
    {
        $items = Auth::user()->items()->scheduled();

        $table = new InventoryScheduled($items);

        return view('mustard::inventory.scheduled', [
            'table' => $table,
            'items' => $table->paginate(),
        ]);
    }
583754
public function get_next_scheduled_time() {
        global $CFG;

        $validminutes = $this->eval_cron_field($this->minute, self::MINUTEMIN, self::MINUTEMAX);
        $validhours = $this->eval_cron_field($this->hour, self::HOURMIN, self::HOURMAX);

        // We need to change to the server timezone before using php date() functions.
        \core_date::set_default_server_timezone();

        $daysinmonth = date("t");
        $validdays = $this->eval_cron_field($this->day, 1, $daysinmonth);
        $validdaysofweek = $this->eval_cron_field($this->dayofweek, 0, 7);
        $validmonths = $this->eval_cron_field($this->month, 1, 12);
        $nextvalidyear = date('Y');

        $currentminute = date("i") + 1;
        $currenthour = date("H");
        $currentday = date("j");
        $currentmonth = date("n");
        $currentdayofweek = date("w");

        $nextvalidminute = $this->next_in_list($currentminute, $validminutes);
        if ($nextvalidminute < $currentminute) {
            $currenthour += 1;
        }
        $nextvalidhour = $this->next_in_list($currenthour, $validhours);
        if ($nextvalidhour < $currenthour) {
            $currentdayofweek += 1;
            $currentday += 1;
        }
        $nextvaliddayofmonth = $this->next_in_list($currentday, $validdays);
        $nextvaliddayofweek = $this->next_in_list($currentdayofweek, $validdaysofweek);
        $daysincrementbymonth = $nextvaliddayofmonth - $currentday;
        if ($nextvaliddayofmonth < $currentday) {
            $daysincrementbymonth += $daysinmonth;
        }

        $daysincrementbyweek = $nextvaliddayofweek - $currentdayofweek;
        if ($nextvaliddayofweek < $currentdayofweek) {
            $daysincrementbyweek += 7;
        }

        // Special handling for dayofmonth vs dayofweek:
        // if either field is * - use the other field
        // otherwise - choose the soonest (see man 5 cron).
        if ($this->dayofweek == '*') {
            $daysincrement = $daysincrementbymonth;
        } else if ($this->day == '*') {
            $daysincrement = $daysincrementbyweek;
        } else {
            // Take the smaller increment of days by month or week.
            $daysincrement = $daysincrementbymonth;
            if ($daysincrementbyweek < $daysincrementbymonth) {
                $daysincrement = $daysincrementbyweek;
            }
        }

        $nextvaliddayofmonth = $currentday + $daysincrement;
        if ($nextvaliddayofmonth > $daysinmonth) {
            $currentmonth += 1;
            $nextvaliddayofmonth -= $daysinmonth;
        }

        $nextvalidmonth = $this->next_in_list($currentmonth, $validmonths);
        if ($nextvalidmonth < $currentmonth) {
            $nextvalidyear += 1;
        }

        // Work out the next valid time.
        $nexttime = mktime($nextvalidhour,
                           $nextvalidminute,
                           0,
                           $nextvalidmonth,
                           $nextvaliddayofmonth,
                           $nextvalidyear);

        return $nexttime;
    }
50703
public function getDates()
    {
        static $dates = [];

        $class = get_class($this);

        if (! isset($dates[$class])) {
            static::$dispatcher->dispatch(
                new ConfigureModelDates($this, $this->dates)
            );

            $dates[$class] = $this->dates;
        }

        return $dates[$class];
    }
881158
protected function seedSchedules()
    {
        $defaultSchedules = [
            [
                'name'         => 'Demo resets every half hour!',
                'message'      => 'You can schedule downtime for _your_ service!',
                'status'       => Schedule::UPCOMING,
                'scheduled_at' => (new DateTime())->add(new DateInterval('PT2H')),
            ],
        ];

        Schedule::truncate();

        foreach ($defaultSchedules as $schedule) {
            Schedule::create($schedule);
        }
    }
734163
public function showIndex()
    {
        $schedule = Schedule::orderBy('created_at')->get();

        return View::make('dashboard.maintenance.index')
            ->withPageTitle(trans('dashboard.schedule.schedule').' - '.trans('dashboard.dashboard'))
            ->withSchedule($schedule);
    }
351851
public function getCrons(): array
    {
        ksort($this->crons);
        $crons = [];

        foreach ($this->crons as $priority => $cs) {
            foreach ($cs as $cron) {
                $crons[$priority . ';' . $cron->getAlias()] = $cron;
            }
        }

        return $crons;
    }
157630
public function meta()
    {
        try {
            $last = e($this->meta['scheduler']->last_run->diffForHumans());
        } catch (Exception $e) {
            $last = 'Never';
        }

        return [
            'Command' => e($this->meta['scheduler']->command),
            'Schedule' => e($this->meta['scheduler']->schedule),
            'Last Run' => $last
        ];
    }