HEX
Server: Apache
System: Linux v38079.2is.nl 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User: democfellows (10015)
PHP: 8.1.34
Disabled: opcache_get_status
Upload Files
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);
		
		
    }
	
	
}