You are here

protected function AcquiaLiftAPI::getDateString in Acquia Lift Connector 7

Returns the timeframe portion of a report API url for the specified dates.

Parameters

$date_start: The start date in the format YYYY-MM-DD or null to use today's date.

null $date_end: The end date in the format YYYY-MM-DD or null for a single date.

Return value

string A string in the format /{start-date}/{end-date}

4 calls to AcquiaLiftAPI::getDateString()
AcquiaLiftAPI::getAPICallsForPeriod in includes/acquia_lift.classes.inc
Returns the number or runtime API calls that were made during the specified period.
AcquiaLiftAPI::getConfidenceReport in includes/acquia_lift.classes.inc
Implements AcquiaLiftReportDataSourceInterface::getConfidenceReport().
AcquiaLiftAPI::getRawLearningReport in includes/acquia_lift.classes.inc
Implements AcquiaLiftReportDataSourceInterface::getRawLearningReport().
AcquiaLiftAPI::getTargetingImpactReport in includes/acquia_lift.classes.inc
Implements AcquiaLiftReportDataSourceInterface::getTargetingImpactReport().

File

includes/acquia_lift.classes.inc, line 1429
Provides an agent type for Acquia Lift

Class

AcquiaLiftAPI
@file Provides an agent type for Acquia Lift

Code

protected function getDateString($date_start, $date_end) {
  if ($date_start === NULL || !preg_match('/\\d{4}\\-\\d{2}\\-\\d{2}/', $date_start)) {
    $date_start = date('Y-m-d');
  }
  $date_str = '/' . $date_start;
  if ($date_end !== NULL && preg_match('/\\d{4}\\-\\d{2}\\-\\d{2}/', $date_end)) {
    $date_str .= '/' . $date_end;
  }
  return $date_str;
}