text changes to registration mail content
[namibia] / module / Repo / src / Repo / Field / Collector.php
1 <?php
2 namespace Repo\Field;
3
4 use Zend\ServiceManager\ServiceLocatorAwareInterface;
5 use Zend\ServiceManager\ServiceLocatorInterface;
6
7
8 class Collector implements ServiceLocatorAwareInterface
9 {
10         /**
11          * @var ServiceLocatorInterface
12          */
13         protected $services;
14         /**
15          * @var array
16          */
17         protected $config;
18
19
20         /**
21          * Initialize new instance.
22          * @return \Repo\Service\Node
23          */
24         public function __construct()
25         {
26                 $this->config = include __DIR__ . '/../../../config/field.config.php';
27                 $this->themeStack = array();
28         }
29
30         /**
31          * @see \Zend\ServiceManager\ServiceLocatorAwareInterface::setServiceLocator()
32          */
33         public function setServiceLocator(ServiceLocatorInterface $serviceLocator)
34         {
35                 $this->services = $serviceLocator;
36         }
37
38         /**
39          * @see \Zend\ServiceManager\ServiceLocatorAwareInterface::getServiceLocator()
40          */
41         public function getServiceLocator()
42         {
43                 return $this->services;
44         }
45
46         /**
47          * Retrieve service config.
48          * @return \Zend\Config\Config
49          */
50         public function getConfig()
51         {
52                 return $this->config;
53         }
54
55         public function collect(array $inputs)
56         {
57                 $inputStack = array();
58                 foreach ($inputs as $group => $fieldSet)
59                 {
60                         $inputStack[$group] = array();
61                         foreach ($fieldSet as $field => $type)
62                         {
63                                 $inputStack[$group][$field] = isset($this->config[$type])
64                                         ? $this->config[$type]
65                                         : $this->config['Default'];
66                         }
67                 }
68                 return $inputStack;
69         }
70
71
72
73 }