File: /var/www/vhosts/creativefellows.nl/apics.creativefellows.nl/23062022/src/Action/Xml/ListJobsXml.php
<?php
namespace App\Action\Xml;
use App\Action\Action;
use App\Domain\Language\LanguageData;
use App\Domain\Feed\Service\FeedReader;
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
use Psr\Container\ContainerInterface;
final class ListJobsXml extends Action
{
protected $container;
private $language;
private $feedReader;
public function __construct(
ContainerInterface $container,
LanguageData $language,
FeedReader $feedReader
){
$this->container = $container;
$this->language = $language;
$this->feedReader = $feedReader;
$this->domain_path = $this->container->get('settings')['domain_path'];
}
public function action() : Response
{
// get all jobs
$feed = $this->feedReader->listJobsXml();
// create xml file
//$xml = $this->jobsXml($jobs);
// return xml to body
$this->response->getBody()->write($feed);
return $this->response
->withHeader('Content-Type', 'application/xml')
->withStatus(200);
}
}