getHubWindowAtThisTime()

@author Tom Haskins-Vaughan <tom@harvestcloud.com>
@since  2012-10-27

@param  \DateTime  $startTime
@param  string     $delivery_type see HubWindow::DELIVERY_TYPE_*

@return mixed      HubWindow or false
324378
public function getHubWindowAtThisTime(\DateTime $startTime, $delivery_type)
    {
        $windows = $this->getHubWindowsIndexedByStartTimeAndDeliveryType();

        if (!empty($windows[$startTime->format(\DateTime::ATOM)][$delivery_type]))
        {
            return $windows[$startTime->format(\DateTime::ATOM)][$delivery_type];
        }

        return false;
    }
1210238
public function serializeDateTime(SerializationVisitorInterface $visitor, \DateTime $date, array $type, SerializationContext $context)
    {
        return $this->serializeDateTimeInterface($visitor, $date, $type, $context);
    }
705832
public function getData(int $type, int $startTime, int $endTime, array $userIdList): array
    {
        return $this->httpClient->postJson('checkin/getcheckindata', [
            'opencheckindatatype' => $type,
            'starttime' => $startTime,
            'endtime' => $endTime,
            'useridlist' => $userIdList
        ]);
    }
728225
public function getRouteCalendars($externalCoverageId, $externalRouteId, \DateTime $startDate, \DateTime $endDate)
    {
        $query = array(
            'api' => 'coverage',
            'parameters' => array(
                'region' => $externalCoverageId,
                'action' => 'calendars',
                'path_filter' => 'routes/'.$externalRouteId,
                'parameters' => '?start_date='.$startDate->format($this->dateFormat).'&end_date='.$endDate->format($this->dateFormat),
            ),
        );

        return $this->navitia_component->call($query);
    }
1003417
protected function _dateDiff($start = null, $stop = null) {
		if ($start) {
			$endDate = $stop instanceof DateTime ? $stop : new DateTime($stop ? $stop : 'now');
			$startDate = $start instanceof DateTime ? $start : new DateTime($start);
			$diff = $startDate->diff($endDate)->format(Configure::read('Task.dateDiffFormat'));
			return $this->_isCli ? $diff : $this->Html->tag('span', $diff);
		} else {
			return $this->_none();
		}
	}
743631
public function reportTrackedEventsByCampaign($campaign_id, $event_type, $start_datetime, $end_datetime, $offset=0)
		{
			$form_data = array(
				'campaign_id' => $campaign_id,
				'event_type' => $event_type,
				'start_datetime' => $start_datetime,
				'end_datetime' => $end_datetime,
				'offset' => $offset
			);
			$xml = $this->call('rpt_tracked_events_by_campaign', $form_data);

			return json_decode(json_encode($xml), TRUE);
		}
966747
public function process(DateTime $startDate, DateTime $endDate, DateTime $cycleDate)
    {
        $this->logger->info('Control Mirakl Settings', array('miraklId' => null, "action" => "Operations creation"));
        // control mirakl settings
        $boolControl = $this->getControlMiraklSettings($this->documentTypes);
        if ($boolControl === false) {
            // log critical
            $title = $this->criticalMessageMiraklSettings;
            $message = $this->formatNotification->formatMessage($title);
            $this->logger->critical($message, array('miraklId' => null, "action" => "Operations creation"));
        } else {
            $this->logger->info(
                'Control Mirakl Settings OK',
                array('miraklId' => null, "action" => "Operations creation")
            );
        }

        $this->logger->info('Cashout Initializer', array('miraklId' => null, "action" => "Operations creation"));

        //Fetch Invoices
        $this->logger->info(
            'Fetch invoices documents from Mirakl from ' .
            $startDate->format('Y-m-d H:i') .
            ' to ' .
            $endDate->format('Y-m-d H:i')
            ,
            array('miraklId' => null, "action" => "Operations creation")
        );

        // get invoices from Mirakl API
        $invoices = $this->getInvoices($startDate, $endDate);

        $this->logger->info(
            '[OK] Fetched ' . count($invoices) . ' invoices',
            array('miraklId' => null, "action" => "Operations creation")
        );

        $this->logger->info('Process invoices', array('miraklId' => null, "action" => "Operations creation"));

        $operations = $this->processInvoices($invoices, $cycleDate);

        $this->saveOperations($operations);

    }
712929
public function reportSubscriberByUpdate($list_id, $start_datetime, $end_datetime)
		{
			$form_data = array(
				'list_id' => $list_id,
				'start_datetime' => $start_datetime,
				'end_datetime' => $end_datetime
			);
			$xml = $this->call('rpt_sub_by_update_datetime', $form_data);

			return json_decode(json_encode($xml), TRUE);
		}
1245584
public function uptime(string $startedAt, string $endedAt, string $split)
    {
        return $this->ohDear->uptime($this->id, $startedAt, $endedAt, $split);
    }
1023079
public function SetClientHour($ClientHour = '', $TransientKey = '') {
      $this->_DeliveryType = DELIVERY_TYPE_BOOL;
      $Success = FALSE;

      if (is_numeric($ClientHour) && $ClientHour >= 0 && $ClientHour < 24) {
         $HourOffset = $ClientHour - date('G', time());
      
         if (Gdn::Session()->IsValid() && Gdn::Session()->ValidateTransientKey($TransientKey)) {
            Gdn::UserModel()->SetField(Gdn::Session()->UserID, 'HourOffset', $HourOffset);
            $Success = TRUE;
         }
      }
         
      $this->Render();
   }
1282774
public function getEvents(\DateTime $begin, \DateTime $end, array $options = array())
    {
        $events = array();

        foreach ($this->providers as $provider) {
            $events = array_merge($events, $provider->getEvents($begin, $end, $options));
        }

        return $events;
    }
1100894
public static function timeRange($field, $title, $startTime = '', $endTime = '')
    {
        return self::timePicker($field, $title, [(string)$startTime, (string)$endTime], TimePicker::TYPE_TIME_RANGE);
    }
182700
public function findOneForHubIdAndStartTime($hub_id, $start_time)
    {
        $qb = $this->getEntityManager()->createQueryBuilder()
            ->from('HarvestCloudCoreBundle:SellerWindow', 'pw')
            ->select('pw')
            ->where('pw.start_time = :start_time')
            ->andWhere('pw.start_time > :now')
            ->setParameter('start_time', date('Y-m-d H:i:s', $start_time))
            ->setParameter('now', date('Y-m-d H:i:s'))
        ;

        $q = $qb->getQuery();

        return $q->getOneOrNullResult();
    }
1332371
public function getStartTimeObject($date_string = null)
    {
        if (null == $date_string)
        {
            $date_string = date('Y-m-d');
        }

        return new \DateTime($date_string.' '.$this->getStartTimeWithSeconds());
    }
402157
public function setDeliveryStart(\DateTimeInterface $deliveryStart = null)
    {
        if (null !== $deliveryStart && $deliveryStart < date_create_from_format('U', (string) time())) {
            throw new InvalidDeliveryStartException();
        }

        $this->deliveryStart = $deliveryStart;

        return $this;
    }
1021905
protected function buildEndpoint($type, $resource, $datetime)
    {
        $accountType = $this->isSubAccount ? 'SubAccounts' : 'Accounts';
        $sig = strtoupper(md5($this->accountSid . $this->accountToken . $datetime));
        return sprintf(self::ENDPOINT_TEMPLATE, self::SERVER_IP, self::SERVER_PORT, self::SDK_VERSION, $accountType, $this->accountSid, $type, $resource, $sig);
    }
1041892
public static function prettyPrintMicroTimeInterval($startTime, $endTime) {
		$seconds = abs($endTime - $startTime);
		return sprintf('%02d:%02d:%02d', ($seconds / 3600), ($seconds / 60 % 60), $seconds % 60);
	}