Retrieve a list of availability for an event date range

@return array
438462
public function find($token, $_params = array()) 
	{
        return $this->transform($this->master->get('availability/' . $token, $_params));
    }
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;
    }
869804
public function getStatusAllowableValues()
    {
        return [
            self::STATUS_ACTIVE,
            self::STATUS_PAUSED,
            self::STATUS_READY,
            self::STATUS_DELIVERED,
            self::STATUS_CANCELLED,
            self::STATUS_REVERTED,
        ];
    }
727080
public function getDates()
    {
        $defaults = [static::CREATED_AT, static::UPDATED_AT, $this->getDeletedAtColumn()];

        return array_merge($this->dates, $defaults);
    }
391825
private function getDateParams()
    {
        $session     = $this->get('session');
        $dateRange   = [];
        $fromSession = $session->get('mautic.daterange.form.from');
        $toSession   = $session->get('mautic.daterange.form.to');
        if (!empty($fromSession) && !empty($toSession)) {
            $dateRange = [
                'dateFrom' => new \DateTime($fromSession),
                'dateTo'   => new \DateTime($toSession),
            ];
        }

        if (empty($dateRange) || empty($dateRange['dateFrom'])) {
            // get System Default Date Ranges
            $dashboardModel = $this->get('mautic.dashboard.model.dashboard');
            $dateRange      = $dashboardModel->getDefaultFilter();
        }

        // clone so the session var doesnt get modified, just the values passed into tables
        $from      = clone $dateRange['dateFrom'];
        $to        = clone $dateRange['dateTo'];
        $params    =[];

        $from->setTimezone(new \DateTimeZone('UTC'));

        $to
            ->add(new \DateInterval('P1D'))
            ->sub(new \DateInterval('PT1S'))
            ->setTimezone(new \DateTimeZone('UTC'));

        $params['dateFrom'] = $from->format('Y-m-d H:i:s');

        $params['dateTo'] = $to->format('Y-m-d H:i:s');

        return $params;
    }
84451
protected function getLastActionDates()
    {
        $sessions = ORM::for_table('sessions')
            ->select_many(
                'user_id',
                'checked_at'
            )
            ->order_by_asc('checked_at')
            ->find_many();
        if (is_array($sessions) && count($sessions) > 0) {
            foreach ($sessions as $session) {
                $this->last_action_dates[$session->user_id] = $session->checked_at;
            }
        }
    }
1093006
public function getAvailableTickets() {
		$available = ArrayList::create();
		$tickets = $this->Tickets();
		foreach($tickets as $ticket) {
			if ($ticket->isAvailable()) {
				$available->push($ticket);
			}
		}
		return $available;
	}
98235
public function getCalendarEnabled()
    {
        if ($this->owner->isReadonly() || $this->owner->isDisabled()) {
            return 'false';
        }
        
        return ($this->calendarDisabled || $this->owner->config()->calendar_disabled) ? 'false' : 'true';
    }
1150955
public function getAvailableFrom()
    {
        if ($this->AvailableFromDate) {
            return $this->dbObject('AvailableFromDate');
        } elseif ($startDate = $this->getEventStartDate()) {
            $lastWeek = new Date();
            $lastWeek->setValue(strtotime(self::config()->get('sale_start_threshold'), strtotime($startDate->value)));
            return $lastWeek;
        }

        return null;
    }
845558
public function getEventAllowableValues()
    {
        return [
            self::EVENT_BOUNCES,
            self::EVENT_HARD_BOUNCES,
            self::EVENT_SOFT_BOUNCES,
            self::EVENT_DELIVERED,
            self::EVENT_SENT,
            self::EVENT_ACCEPTED,
            self::EVENT_UNSUBSCRIPTION,
            self::EVENT_REPLIES,
            self::EVENT_BLOCKED,
        ];
    }
878513
public function listEvents(Carbon $startDateTime = null, Carbon $endDateTime = null, array $queryParameters = []): array
    {
        $parameters = [
            'singleEvents' => true,
            'orderBy' => 'startTime',
        ];

        if (is_null($startDateTime)) {
            $startDateTime = Carbon::now()->startOfDay();
        }

        $parameters['timeMin'] = $startDateTime->format(DateTime::RFC3339);

        if (is_null($endDateTime)) {
            $endDateTime = Carbon::now()->addYear()->endOfDay();
        }
        $parameters['timeMax'] = $endDateTime->format(DateTime::RFC3339);

        $parameters = array_merge($parameters, $queryParameters);

        return $this
            ->calendarService
            ->events
            ->listEvents($this->calendarId, $parameters)
            ->getItems();
    }
639883
public static function getAll()
    {
        $timezones = [];
        $identifiers = DateTimeZone::listIdentifiers();
        foreach ($identifiers as $identifier) {
            $date = new DateTime("now", new DateTimeZone($identifier));
            $offsetText = $date->format("P");
            $offsetInHours = $date->getOffset() / 60 / 60;
            $timezones[] = [
                "identifier" => $identifier,
                "name" => "(GMT{$offsetText}) $identifier",
                "offset" => $offsetInHours
            ];
        }

        ArrayHelper::multisort($timezones, "offset", SORT_ASC, SORT_NUMERIC);
        return $timezones;
    }
673987
private function getTimePeriodChoices(): array
    {
        $choices = [];
        foreach ($this->getTimePeriodField() as $label => $value) {
            $choices[$label] = $value;
        }

        return $choices;
    }
551418
public function getAvailableIDs(): array
    {
        if ($this->availableTz === null) {
            $this->availableTz = [];
            $available = $this->timeZoneClass->getAvailableIDs();
            foreach ($available as $id) {
                $this->availableTz[] = $id;
            }
        }

        return $this->availableTz;
    }
1264620
protected function getDates()
    {
        $date = new \DateTime ( "now" );
        $date->setTimezone ( new \DateTimeZone ( "America/Sao_Paulo" ) );

        $final = $date->format ( "Y-m-d\TH:i:s" );

        $dateInterval = "P" . ( string ) $this->_days . "D";
        $date->sub ( new \DateInterval ( $dateInterval ) );
        $date->setTime ( 00, 00, 00 );
        $initial = $date->format ( "Y-m-d\TH:i:s" );

        return [
            'initial' => $initial,
            'final'   => $final
        ];
    }
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];
    }
49157
public function getCalendars()
    {
        //build URI
        $strURI = Product::$baseProductUri . '/tasks/' . $this->getFileName() . '/calendars/';

        //sign URI
        $signedURI = Utils::sign($strURI);

        $responseStream = Utils::processCommand($signedURI, 'GET', '', '');

        $json = json_decode($responseStream);

        if ($json->Code == 200)
            return $json->Calendars->List;
        else
            return false;
    }