mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-12 00:45:34 +00:00
getDocumentContent() returns null if no document was found
This commit is contained in:
parent
b6452faa9b
commit
96f858cbdd
|
@ -831,17 +831,19 @@ class SeedDMS_Core_DMS {
|
|||
* This function retrieves a document content from the database by its id.
|
||||
*
|
||||
* @param integer $id internal id of document content
|
||||
* @return bool|SeedDMS_Core_Document or false
|
||||
* @return bool|null|SeedDMS_Core_DocumentContent found document content or null if not document content was found or false in case of an error
|
||||
|
||||
*/
|
||||
function getDocumentContent($id) { /* {{{ */
|
||||
if (!is_numeric($id)) return false;
|
||||
if (!is_numeric($id)) return false;
|
||||
if ($id < 1) return false;
|
||||
|
||||
$queryStr = "SELECT * FROM `tblDocumentContent` WHERE `id` = ".(int) $id;
|
||||
$resArr = $this->db->getResultArray($queryStr);
|
||||
if (is_bool($resArr) && $resArr == false)
|
||||
return false;
|
||||
if (count($resArr) != 1)
|
||||
return false;
|
||||
return null;
|
||||
$row = $resArr[0];
|
||||
|
||||
$document = $this->getDocument($row['document']);
|
||||
|
|
Loading…
Reference in New Issue
Block a user