File: /var/www/vhosts/creativefellows.nl/apics.creativefellows.nl/src/Domain/Feed/Service/FeedReader.php
<?php
namespace App\Domain\Feed\Service;
use App\Domain\Jobs\Repository\JobRepository;
use App\Domain\Jobs\Service\JobReader;
use App\Domain\XML\XmlJobData;
use App\Domain\XML\MySimpleXMLElement;
use Psr\Container\ContainerInterface;
use Slim\Interfaces\RouteParserInterface;
final class FeedReader
{
private $jobReader;
protected $container;
protected $jobs = [];
protected $xml;
public function __construct(
ContainerInterface $container,
RouteParserInterface $routeParser,
JobReader $jobReader,
XmlJobData $XmlJobData
){
$this->container = $container;
$this->router = $routeParser;
$this->jobReader = $jobReader;
$this->xml = $XmlJobData;
}
public function listJobsXml()
{
$this->xml->setDomain( $this->container->get('settings')['domain_path'] );
$this->xml->setJobs( $this->jobReader->listAllJobs() );
return $this->xml->asXML();
}
}