system/modules/DocumentManagementSystem/classes/DmsLoader.php
public function loadDocument($documentId, \DmsLoaderParams $params)
  {
    $objDocument = $this->Database->prepare("SELECT d.*, CONCAT(m1.firstname, ' ', m1.lastname) AS upload_member_name, CONCAT(m2.firstname, ' ', m2.lastname) AS lastedit_member_name "
                        . "FROM tl_dms_documents d "
                        . "LEFT JOIN tl_member m1 ON m1.id = d.upload_member "
                        . "LEFT JOIN tl_member m2 ON m2.id = d.lastedit_member "
                        . "WHERE d.id = ?")
                    ->limit(1)
                    ->execute($documentId);
    
    $document = null;
    if ($objDocument->numRows)
    {
      $document = $this->buildDocument($objDocument);
      if ($params->loadCategory)
      {
        $document->category = $this->loadCategory($document->categoryId, $params);
      }
    }

    return $document;
  }
public function loadDocument($documentId, \DmsLoaderParams $params)
  {
    $objDocument = $this->Database->prepare("SELECT d.*, CONCAT(m1.firstname, ' ', m1.lastname) AS upload_member_name, CONCAT(m2.firstname, ' ', m2.lastname) AS lastedit_member_name "
                        . "FROM tl_dms_documents d "
                        . "LEFT JOIN tl_member m1 ON m1.id = d.upload_member "
                        . "LEFT JOIN tl_member m2 ON m2.id = d.lastedit_member "
                        . "WHERE d.id = ?")
                    ->limit(1)
                    ->execute($documentId);
    
    $document = null;
    if ($objDocument->numRows)
    {
      $document = $this->buildDocument($objDocument);
      if ($params->loadCategory)
      {
        $document->category = $this->loadCategory($document->categoryId, $params);
      }
    }

    return $document;
  }
public function loadDocument ( $ documentId , \ DmsLoaderParams $ params ) { $ objDocument = $ this -> Database -> prepare ( "SELECT d.*, CONCAT(m1.firstname, ' ', m1.lastname) AS upload_member_name, CONCAT(m2.firstname, ' ', m2.lastname) AS lastedit_member_name " . "FROM tl_dms_documents d " . "LEFT JOIN tl_member m1 ON m1.id = d.upload_member " . "LEFT JOIN tl_member m2 ON m2.id = d.lastedit_member " . "WHERE d.id = ?" ) -> limit ( 1 ) -> execute ( $ documentId ) ; $ document = null ; if ( $ objDocument -> numRows ) { $ document = $ this -> buildDocument ( $ objDocument ) ; if ( $ params -> loadCategory ) { $ document -> category = $ this -> loadCategory ( $ document -> categoryId , $ params ) ; } } return $ document ; }
Load the document with the given id.

@param  int  $documentId  The id of the document to load.
@param  DmsLoaderParams  $params  The configured params to use while loading.
@return  document  Returns the document.
Load the document with the given id .