4 use Zend\ServiceManager\ServiceLocatorAwareInterface;
5 use Zend\ServiceManager\ServiceLocatorInterface;
8 class Collector implements ServiceLocatorAwareInterface
11 * @var ServiceLocatorInterface
21 * Initialize new instance.
22 * @return \Repo\Service\Node
24 public function __construct()
26 $this->config = include __DIR__ . '/../../../config/field.config.php';
27 $this->themeStack = array();
31 * @see \Zend\ServiceManager\ServiceLocatorAwareInterface::setServiceLocator()
33 public function setServiceLocator(ServiceLocatorInterface $serviceLocator)
35 $this->services = $serviceLocator;
39 * @see \Zend\ServiceManager\ServiceLocatorAwareInterface::getServiceLocator()
41 public function getServiceLocator()
43 return $this->services;
47 * Retrieve service config.
48 * @return \Zend\Config\Config
50 public function getConfig()
55 public function collect(array $inputs)
57 $inputStack = array();
58 foreach ($inputs as $group => $fieldSet)
60 $inputStack[$group] = array();
61 foreach ($fieldSet as $field => $type)
63 $inputStack[$group][$field] = isset($this->config[$type])
64 ? $this->config[$type]
65 : $this->config['Default'];