initial commit
[namibia] / module / PriceGuide / src / PriceGuide / Controller / PriceGuideController.php
1 <?php
2 namespace PriceGuide\Controller;
3
4
5
6 class PriceGuideController extends \Zend\Mvc\Controller\AbstractActionController
7 {
8
9         public function notifyAction()
10         {
11                 \Utility\Registry::setServiceManager($this->serviceLocator);
12                 \Utility\Registry::addDynamicConfig(
13                                 \Utility\Registry::getEntityManager()
14                                         ->getRepository('Config\Entity\Config')
15                                         ->find(1)
16                                         ->toArray()
17                                 );
18                 $service = new \PriceGuide\Service\PriceGuide();
19                 $service->setWorkflow($this->serviceLocator->get('PriceGuide'));
20                 $pgId = $this->getRequest()->getParam('pgId');
21                 $fromCompanyId = $this->getRequest()->getParam('cmpId');
22                 $fromProfileId = $this->getRequest()->getParam('prfId');
23                 $record = \Utility\Registry::getEntityManager()
24                                         ->getRepository('PriceGuide\Entity\PriceGuide')
25                                         ->find($pgId);
26                 $service->sendToMembers($record, $fromCompanyId, $fromProfileId);
27                 return "\n";
28         }
29
30         public function processAction()
31         {
32                 \Utility\Registry::setServiceManager($this->serviceLocator);
33                 \Utility\Registry::addDynamicConfig(
34                                 \Utility\Registry::getEntityManager()
35                                 ->getRepository('Config\Entity\Config')
36                                 ->find(1)
37                                 ->toArray()
38                 );
39                 $service = new \PriceGuide\Service\PriceGuide();
40                 $service->setWorkflow($this->serviceLocator->get('PriceGuide'));
41                 $service->cronProcess();
42                 return "\n";
43         }
44
45 }