This repository has been archived by the owner on Jul 20, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIdentificationCodesDAO.inc.php
executable file
·53 lines (43 loc) · 1.74 KB
/
IdentificationCodesDAO.inc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
/**
* @file plugins/generic/identificationCodes/IdentificationCodesDAO.inc.php
*
* Copyright (c) 2016 Language Science Press
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
*
* @class IdentificationCodesDAO
*
*/
class IdentificationCodesDAO extends DAO {
/**
* Constructor
*/
function IdentificationCodesDAO() {
parent::DAO();
}
function getData() {
$result = $this->retrieve("SELECT pf.publication_format_id, pfs.setting_value AS pfname, ic.code, ic.value, pf.submission_id,ss.setting_value AS btitle FROM identification_codes ic LEFT JOIN publication_formats pf ON pf.publication_format_id=ic.publication_format_id
LEFT JOIN publication_format_settings pfs ON pf.publication_format_id=pfs.publication_format_id
LEFT JOIN submission_settings ss ON ss.submission_id=pf.submission_id WHERE ss.setting_name='title' AND ss.locale='en_US' ORDER BY pf.submission_id"
);
if ($result->RecordCount() == 0) {
$result->Close();
return null;
} else {
$identificationCodes = array();
while (!$result->EOF) {
$row = $result->getRowAssoc(false);
$publicationFormatId = $this->convertFromDB($row['publication_format_id'],null);
$codeId = $this->convertFromDB($row['code'],null);
$identificationCodes[$publicationFormatId]['subId'] = $this->convertFromDB($row['submission_id'],null);
$identificationCodes[$publicationFormatId]['title'] = $this->convertFromDB($row['btitle'],null);
$identificationCodes[$publicationFormatId]['publicationFormat'] = $this->convertFromDB($row['pfname'],null);
$identificationCodes[$publicationFormatId][$codeId] = $this->convertFromDB($row['value'],null);
$result->MoveNext();
}
$result->Close();
return $identificationCodes;
}
}
}
?>