preparing for 5.0.1 release in several weeks (#1509)
[openemr.git] / library / ESign / Abstract / Model.php
blob13ffdd1d3fcf2e9c3c35c0fa17640e33f1c07ea1
1 <?php
3 namespace ESign;
5 /**
6 * Any model can inherit this class to add some common functionality
8 * Copyright (C) 2013 OEMR 501c3 www.oemr.org
10 * LICENSE: This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 3
13 * of the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
21 * @package OpenEMR
22 * @author Ken Chapple <ken@mi-squared.com>
23 * @author Medical Information Integration, LLC
24 * @link http://www.open-emr.org
25 **/
27 abstract class Abstract_Model
29 private $_args = array();
31 public function __construct(array $args = null)
33 if ($args !== null) {
34 $this->_args = $args;
38 protected function pushArgs($force = false)
40 foreach ($this->_args as $key => $value) {
41 if ($force) {
42 $this->{$key} = $value;
43 } else {
44 if (property_exists($this, $key)) {
45 $this->{$key} = $value;
46 } else if (property_exists($this, "_".$key)) {
47 $this->{"_".$key} = $value;