/** * @covers DateTimeUtils::FromDfpDateTime */ public function testFromDfpDateTime() { $this->assertEquals($this->dateTime1, DateTimeUtils::FromDfpDateTime($this->dfpDateTime1)); $this->assertEquals($this->dateTime2, DateTimeUtils::FromDfpDateTime($this->dfpDateTime2)); $this->assertEquals($this->dateTime3, DateTimeUtils::FromDfpDateTime($this->dfpDateTime3)); }
$fp = fopen($fn, "a"); fwrite($fp, implode(',', array('orderId', 'orderName', 'lineItemId', 'lineItemName', 'externalId', 'creationDateTime', 'startDateTime', 'endDateTime', 'priority', 'costType', 'lineItemType', 'impressionsDelivered', 'clicksDelivered', 'expectedDeliveryPercentage', 'actualDeliveryPercentage', 'status', 'notes', 'isMissingCreatives', 'primaryGoalType', 'primaryGoalUnitType', 'primaryGoalUnits', 'targetingGeo', 'targetingExcludedAdunits', 'targetingBrowser', 'targetingCategory', 'targetingDevice', 'targetingOs', 'targetingOsVersion', 'targetingCustom', 'frequencyCaps', 'targetingPlatform')) . "\n"); do { // Get line items by statement. $page = $lineItemService->getLineItemsByStatement($statementBuilder->ToStatement()); // Save results. if (isset($page->results)) { $totalResultSetSize = $page->totalResultSetSize; $i = $page->startIndex; foreach ($page->results as $lineItem) { //print_r(get_object_vars($lineItem)); exit; //print_r($lineItem->targeting); if (is_null($lineItem->creationDateTime)) { $creationDateTimeString = null; } else { $creationDateTime = $dateTimeUtils->FromDfpDateTime($lineItem->creationDateTime); $creationDateTime->setTimezone(new DateTimeZone('Europe/Amsterdam')); $creationDateTimeString = $creationDateTime->format('Y-m-d H:i:s'); } if (is_null($lineItem->startDateTime)) { $startDateTimeString = null; } else { $startDateTime = $dateTimeUtils->FromDfpDateTime($lineItem->startDateTime); $startDateTime->setTimezone(new DateTimeZone('Europe/Amsterdam')); $startDateTimeString = $startDateTime->format('Y-m-d H:i:s'); } if (is_null($lineItem->endDateTime)) { $endDateTimeString = null; } else { $endDateTime = $dateTimeUtils->FromDfpDateTime($lineItem->endDateTime); $endDateTime->setTimezone(new DateTimeZone('Europe/Amsterdam'));