mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-05-06 18:15:22 +02:00
64 lines
1.7 KiB
PHP
64 lines
1.7 KiB
PHP
<?php
|
|
|
|
namespace Infinito\Domain\DataAccessManagement;
|
|
|
|
use Doctrine\Common\Collections\Collection;
|
|
use Doctrine\Common\Collections\ArrayCollection;
|
|
|
|
/**
|
|
* @author kevinfrantz
|
|
*/
|
|
final class ActionsViewsDAOService extends AbstractActionsDAO implements ActionsViewsDAOServiceInterface
|
|
{
|
|
/**
|
|
* @var ActionsResultsDAOServiceInterface
|
|
*/
|
|
private $actionsResultsDAO;
|
|
|
|
/**
|
|
* @param ActionsResultsDAOServiceInterface $actionsResultsDAO
|
|
*/
|
|
public function __construct(ActionsResultsDAOServiceInterface $actionsResultsDAO)
|
|
{
|
|
$this->actionsResultsDAO = $actionsResultsDAO;
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*
|
|
* @see \Infinito\Domain\DataAccessManagement\ActionsDAOInterface::isDataStored()
|
|
*/
|
|
public function isDataStored(string $actionType): bool
|
|
{
|
|
return $this->actionsResultsDAO->isDataStored($actionType);
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*
|
|
* @see \Infinito\Domain\DataAccessManagement\ActionsDAOInterface::getAllStoredData()
|
|
*/
|
|
public function getAllStoredData(): Collection
|
|
{
|
|
$storedData = new ArrayCollection();
|
|
$allProccessedDataKeys = $this->actionsResultsDAO->getAllStoredData()->getKeys();
|
|
foreach ($allProccessedDataKeys as $key) {
|
|
$viewData = $this->getData($key);
|
|
$storedData->set($key, $viewData);
|
|
}
|
|
|
|
return $storedData;
|
|
}
|
|
|
|
/**
|
|
* @todo Implement the mapping
|
|
* {@inheritdoc}
|
|
*
|
|
* @see \Infinito\Domain\DataAccessManagement\ActionsDAOInterface::getData()
|
|
*/
|
|
public function getData(string $actionType)
|
|
{
|
|
return $this->actionsResultsDAO->getData($actionType);
|
|
}
|
|
}
|