Class Maintenance

Description

A static class for providing common methods for the maintenance scripts.

  • static:

Located in /maintenance/libraries/max/Maintenance.php (line 46)


	
			
Method Summary
 boolean checkDatesInSameHour (Date $start, Date $end)
 bool checkIntervalDates (Date $start, Date $end, integer $operationInterval)
 integer|false convertDateRangeToOperationIntervalID (Date $start, Date $end, mixed $operationInterval, integer $operation_interval)
 integer convertDateToOperationIntervalID (mixed $date, mixed $operationInterval, Date $time, integer $operation_interval)
 array convertDateToOperationIntervalStartAndEndDates (Date $date, mixed $operationInterval, integer $operation_interval)
 void getOperationIntervalRange (array &$operationIntervals, Date $date, integer $intervals, integer $operationInterval)
 integer nextOperationIntervalID (integer $operationIntervalID, integer $operationInterval)
 string prepareActivateCampaignEmail (string $contactName, string $campaignName, array &$advertisements)
 string prepareDeactivateCampaignEmail (string $contactName, string $campaignName, integer $reason, array &$advertisements)
 integer previousOperationIntervalID (integer $operationIntervalID, integer $operationInterval)
Methods
checkDatesInSameHour (line 245)

A static method to ensure that a Date range is in the same hour.

  • return: Returns true if the dates are in the same hour, false otherwise.
  • static:
boolean checkDatesInSameHour (Date $start, Date $end)
  • Date $start: The start date to check.
  • Date $end: The end date to check.
checkIntervalDates (line 273)

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.

  • return: Returns true if the dates are correct interval start/end dates, false 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.
convertDateRangeToOperationIntervalID (line 63)

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.

  • return: The operation interval ID, or false if the date range spans more than one operation interval.
  • static:
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.
convertDateToOperationIntervalID (line 103)

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.

  • return: The operation interval ID that the time is in.
  • static:
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.
convertDateToOperationIntervalStartAndEndDates (line 127)

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.

  • return: An array of the start and end Dates of the operation interval.
  • static:
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.
getOperationIntervalRange (line 212)

A static method to calculate and return a range of operation intervals.

  • static:
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.
maxConnectionWindows (line 335)

A method to find the largest, active impression and click connection windows.

  • return: Returns an array containing the largest active impression and click connection windows. Default values are zero.
  • static:
array maxConnectionWindows ()
nextOperationIntervalID (line 182)

A static method to find the next operation interval ID.

  • return: The next operation interval ID.
  • static:
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.
prepareActivateCampaignEmail (line 382)

A static method for premaring e-mails, advising of the activation of campaigns.

  • return: The email that has been prepared.
  • static:
string prepareActivateCampaignEmail (string $contactName, string $campaignName, array &$advertisements)
  • string $contactName: The name of the campaign contact.
  • string $campaignName: The name of the deactivated campaign.
  • array $advertisements: A reference to an array of advertisements in the campaign, indexed by advertisement_id, of an array containing the description, alt description, and destination URL of the advertisement.
prepareDeactivateCampaignEmail (line 429)

A static method for preparing e-mails, advising of the deactivation of campaigns.

  • return: The email that has been prepared.
  • static:
string prepareDeactivateCampaignEmail (string $contactName, string $campaignName, integer $reason, array &$advertisements)
  • 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 $advertisements: A reference to an array of advertisements in the campaign, indexed by advertisement_id, of an array containing the description, alt description, and destination URL of the advertisement.
previousOperationIntervalID (line 159)

A static method to find the previous operation interval ID.

  • return: The previous operation interval ID.
  • static:
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.

Documentation generated on Fri, 10 Dec 2004 18:25:48 +0000 by phpDocumentor 1.3.0RC3