Highway to PSR2
[openemr.git] / library / ESign / Form / LBF / Signable.php
blob271cd6a1c749e07525f591beb258a484ebae0aa0
1 <?php
3 namespace ESign;
5 /**
6 * LBF Form implementation of SignableIF interface, which represents an
7 * object that can be signed, locked and/or amended.
9 * Copyright (C) 2013 OEMR 501c3 www.oemr.org
11 * LICENSE: This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 3
14 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
22 * @package OpenEMR
23 * @author Ken Chapple <ken@mi-squared.com>
24 * @author Medical Information Integration, LLC
25 * @link http://www.open-emr.org
26 **/
28 require_once $GLOBALS['srcdir'].'/ESign/Form/Signable.php';
29 require_once $GLOBALS['srcdir'].'/ESign/SignableIF.php';
31 class Form_LBF_Signable extends Form_Signable implements SignableIF
33 /**
34 * Get the data in an array for this form.
36 * get the lbf form key, and all the entries associates with that key
38 * @see \ESign\SignableIF::getData()
40 public function getData()
42 // First we have to get the form_id from the forms tagle because that's our key to the lbf_data table
43 $statement = "SELECT form_id FROM forms WHERE id = ?";
44 $row = sqlQuery($statement, array( $this->_formId ));
45 // Now we can look for the data in the lbf_data table.
46 $data = array();
47 if ($row) {
48 $fres = sqlStatement("SELECT field_id, field_value FROM lbf_data WHERE form_id = ?", array( $row['form_id'] ));
49 while ($frow = sqlFetchArray($fres)) {
50 $data[$frow['field_id']] = $frow['field_value'];
54 return $data;