system/modules/DocumentManagementSystem/classes/DmsLoader.php
public function loadDocuments($strFileName, $strFileType, \DmsLoaderParams $params)
  {
    $arrDocuments = array();
    $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.data_file_name = ? AND d.data_file_type = ? "
                        . "ORDER BY d.version_major, d.version_minor, d.version_patch")
                    ->execute(array($strFileName, $strFileType));
    
    $document = null;
    while ($objDocument->next())
    {
      $document = $this->buildDocument($objDocument);
      if ($params->loadCategory)
      {
        $document->category = $this->loadCategory($document->categoryId, $params);
      }
      $arrDocuments[] = $document;
    }

    return $arrDocuments;
  }
public function loadDocuments($strFileName, $strFileType, \DmsLoaderParams $params)
  {
    $arrDocuments = array();
    $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.data_file_name = ? AND d.data_file_type = ? "
                        . "ORDER BY d.version_major, d.version_minor, d.version_patch")
                    ->execute(array($strFileName, $strFileType));
    
    $document = null;
    while ($objDocument->next())
    {
      $document = $this->buildDocument($objDocument);
      if ($params->loadCategory)
      {
        $document->category = $this->loadCategory($document->categoryId, $params);
      }
      $arrDocuments[] = $document;
    }

    return $arrDocuments;
  }
public function loadDocuments ( $ strFileName , $ strFileType , \ DmsLoaderParams $ params ) { $ arrDocuments = array ( ) ; $ 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.data_file_name = ? AND d.data_file_type = ? " . "ORDER BY d.version_major, d.version_minor, d.version_patch" ) -> execute ( array ( $ strFileName , $ strFileType ) ) ; $ document = null ; while ( $ objDocument -> next ( ) ) { $ document = $ this -> buildDocument ( $ objDocument ) ; if ( $ params -> loadCategory ) { $ document -> category = $ this -> loadCategory ( $ document -> categoryId , $ params ) ; } $ arrDocuments [ ] = $ document ; } return $ arrDocuments ; }
Load the documents for the given file name and type.

@param  string  $strFileName  The common file name for the documents to load.
@param  string  $strFileType  The common file type for the documents to load.
@param  DmsLoaderParams  $params  The configured params to use while loading.
@return  array  Returns an array of matching the documents.
Load the documents for the given file name and type .