Added the zend framework 2 library, the path is specified in line no.26 in zend_modul...
[openemr.git] / interface / modules / zend_modules / library / Zend / ModuleManager / ModuleEvent.php
blobe29dd8e2834fc1ad0344b2b41d834cb7398d2f73
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
8 */
10 namespace Zend\ModuleManager;
12 use Zend\EventManager\Event;
14 /**
15 * Custom event for use with module manager
16 * Composes Module objects
18 class ModuleEvent extends Event
20 /**
21 * Module events triggered by eventmanager
23 CONST EVENT_MERGE_CONFIG = 'mergeConfig';
24 CONST EVENT_LOAD_MODULES = 'loadModules';
25 CONST EVENT_LOAD_MODULE_RESOLVE = 'loadModule.resolve';
26 CONST EVENT_LOAD_MODULE = 'loadModule';
27 CONST EVENT_LOAD_MODULES_POST = 'loadModules.post';
29 /**
30 * @var mixed
32 protected $module;
34 /**
35 * @var string
37 protected $moduleName;
39 /**
40 * @var Listener\ConfigMergerInterface
42 protected $configListener;
44 /**
45 * Get the name of a given module
47 * @return string
49 public function getModuleName()
51 return $this->moduleName;
54 /**
55 * Set the name of a given module
57 * @param string $moduleName
58 * @throws Exception\InvalidArgumentException
59 * @return ModuleEvent
61 public function setModuleName($moduleName)
63 if (!is_string($moduleName)) {
64 throw new Exception\InvalidArgumentException(sprintf(
65 '%s expects a string as an argument; %s provided'
66 ,__METHOD__, gettype($moduleName)
67 ));
69 // Performance tweak, don't add it as param.
70 $this->moduleName = $moduleName;
72 return $this;
75 /**
76 * Get module object
78 * @return null|object
80 public function getModule()
82 return $this->module;
85 /**
86 * Set module object to compose in this event
88 * @param object $module
89 * @throws Exception\InvalidArgumentException
90 * @return ModuleEvent
92 public function setModule($module)
94 if (!is_object($module)) {
95 throw new Exception\InvalidArgumentException(sprintf(
96 '%s expects a module object as an argument; %s provided'
97 ,__METHOD__, gettype($module)
98 ));
100 // Performance tweak, don't add it as param.
101 $this->module = $module;
103 return $this;
107 * Get the config listener
109 * @return null|Listener\ConfigMergerInterface
111 public function getConfigListener()
113 return $this->configListener;
117 * Set module object to compose in this event
119 * @param Listener\ConfigMergerInterface $configListener
120 * @return ModuleEvent
122 public function setConfigListener(Listener\ConfigMergerInterface $configListener)
124 $this->setParam('configListener', $configListener);
125 $this->configListener = $configListener;
127 return $this;