File: D:/HostingSpaces/SBogers10/deensekroon.komma-mediadesign.nl/wwwroot/App/Feeds/FeedController.php
<?php
namespace App\Feeds;
include_once $_SERVER['DOCUMENT_ROOT'] . '/App/Feeds/FeedService.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/App/Feeds/FeedXmlWriter.php';
class FeedController
{
private $service;
private $writer;
public function __construct()
{
$this->service = new FeedService();
$this->writer = new FeedXmlWriter();
}
/**
* Write products to an XMl format
*/
public function google()
{
// Get products for the feed
$products = $this->service->productsForGoogleFeed();
// Write products to an XML format
$this->writer->writeGoogleFeed($products);
}
/**
* Write products to an XMl format
*/
public function daisycon()
{
// Get products for the feed
$products = $this->service->productsForDaisyconFeed();
// Write products to an XML format
$this->writer->writeDaisyconFeed($products);
}
}