Modifications for module installer in openemr.
[openemr.git] / interface / modules / zend_modules / module / Application / src / Application / Plugin / CommonPlugin.php
blob111a014bd48354109cd5c9e49ace365cd09cd2e2
1 <?php
2 /* +-----------------------------------------------------------------------------+
3 * OpenEMR - Open Source Electronic Medical Record
4 * Copyright (C) 2013 Z&H Consultancy Services Private Limited <sam@zhservices.com>
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Affero General Public License as
8 * published by the Free Software Foundation, either version 3 of the
9 * License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Affero General Public License for more details.
16 * You should have received a copy of the GNU Affero General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 * @author Remesh Babu S <remesh@zhservices.com>
19 * +------------------------------------------------------------------------------+
21 namespace Application\Plugin;
23 use Zend\Mvc\Controller\Plugin\AbstractPlugin;
24 use Application\Model\ApplicationTable;
25 use Application\Listener\Listener;
27 class CommonPlugin extends AbstractPlugin
30 /**
31 * Application Table Object
32 * Listener Oblect
33 * @param type $sm Service Manager
35 public function __construct($sm)
37 $sm->get('Zend\Db\Adapter\Adapter');
38 $this->application = new ApplicationTable();
39 $this->listenerObject = new Listener;
42 /**
43 * Function checkACL
44 * Plugin functions are easily access from any where in the project
45 * Call the ACL Check function zAclCheck from ApplicationTable
47 * @param int $useID
48 * @param string $sectionID
49 * @return type
51 public function checkACL($useID, $sectionID)
53 return $this->application->zAclCheck($useID, $sectionID);