A static method to ensure that a Date range is in the same hour.
boolean
checkDatesInSameHour
(
Date $start,
Date $end)
-
Date
$start: The start date to check.
-
Date
$end: The end date to check.
A method to check that two Dates represent either the start and end of an operation interval, if the operation interval is less than an hour, or the start and end of an hour otherwise.
bool
checkIntervalDates
(
Date $start,
Date $end,
integer $operationInterval)
-
Date
$start: The interval start date.
-
Date
$end: The interval end date.
-
integer
$operationInterval: The operation interval in minutes.
A static method to convert a date range (in the form of two Dates) and return the operation interval ID represented by the range, or false if the date range spans more than one operation interval ID.
integer|false
convertDateRangeToOperationIntervalID
(
Date $start,
Date $end,
mixed $operationInterval,
integer $operation_interval)
-
Date
$start: The start date of the date range.
-
Date
$end: The end date of the date range.
-
integer
$operation_interval: Optional length of the operation interval in minutes. If not given, will use the currently defined operation interval.
A static method to convert a Date object into the appropriate operation interval ID (of the week).
Works by finding out how many days, hours, minutes into the week the time is, and then converting that into how many minutes into the week the time is. This value is then divided by the interval length (in minutes) to determine how many intervals into the week the time is.
integer
convertDateToOperationIntervalID
(
mixed $date,
mixed $operationInterval,
Date $time,
integer $operation_interval)
-
Date
$time: The date to convert.
-
integer
$operation_interval: Optional length of the operation interval in minutes. If not given, will use the currently defined operation interval.
A static method to convert a Date into an array containing the start and end dates of the operation interval that the date is in.
array
convertDateToOperationIntervalStartAndEndDates
(
Date $date,
mixed $operationInterval,
integer $operation_interval)
-
Date
$date: The date to convert.
-
integer
$operation_interval: Optional length of the operation interval in minutes. If not given, will use the currently defined operation interval.
A static method to calculate and return a range of operation intervals.
void
getOperationIntervalRange
(
array &$operationIntervals,
Date $date,
integer $intervals,
integer $operationInterval)
-
array
$operationIntervals: A reference to an array that will be set to contain a series of arrays with the start and end Dates of the operation intervals in the range, indexed by the operation interval IDs.
-
Date
$date: A date in the FIRST operation interval of the range to be calculated.
-
integer
$intervals: The number of operation intervals in the range, inclusive of the first and last intervals.
-
integer
$operationInterval: Optional length of the operation interval in minutes. If not given, will use the currently defined operation interval.
A method to find the largest, active impression and click connection windows.
array
maxConnectionWindows
()
A static method to find the next operation interval ID.
integer
nextOperationIntervalID
(integer $operationIntervalID, integer $operationInterval)
-
integer
$operationIntervalID: The operation interval ID.
-
integer
$operationInterval: Optional length of the operation interval in minutes. If not given, will use the currently defined operation interval.
A static method for premaring e-mails, advising of the activation of campaigns.
string
prepareActivateCampaignEmail
(string $contactName, string $campaignName, array &$ads)
-
string
$contactName: The name of the campaign contact.
-
string
$campaignName: The name of the deactivated campaign.
-
array
$ads: A reference to an array of ads in the campaign, indexed by ad_id, of an array containing the description, alt description, and destination URL of the ad.
A static method for preparing e-mails, advising of the deactivation of campaigns.
string
prepareDeactivateCampaignEmail
(string $contactName, string $campaignName, integer $reason, array &$ads)
-
string
$contactName: The name of the campaign contact.
-
string
$campaignName: The name of the deactivated campaign.
-
integer
$reason: A binary flag field containting the reason(s) the campaign was deactivated: 2 - No more impressions 4 - No more clicks 8 - No more conversions 16 - Campaign ended (due to date)
-
array
$ads: A reference to an array of ads in the campaign, indexed by ad_id, of an array containing the description, alt description, and destination URL of the ad.
A static method to find the previous operation interval ID.
integer
previousOperationIntervalID
(integer $operationIntervalID, integer $operationInterval)
-
integer
$operationIntervalID: The operation interval ID.
-
integer
$operationInterval: Optional length of the operation interval in minutes. If not given, will use the currently defined operation interval.