system/modules/DocumentManagementSystem/classes/DmsLoader.php
private function getDocuments(\Category $category, \DmsLoaderParams $params)
  {
    $whereClause = "WHERE d.pid = ? ";
    
    $whereParams = array();
    $whereParams[] = $category->id;
    
    if ($params->hasDocumentSearchText())
    {
      if ($params->documentSearchType == \DmsLoaderParams::DOCUMENT_SEARCH_LIKE)
      {
        $whereClause .= "AND (UPPER(d.name) LIKE ? OR UPPER(d.description) LIKE ? OR UPPER(d.keywords) LIKE ?) ";
        $seachText = "%" . $params->documentSearchText . "%";
      }
      else
      {
        $whereClause .= "AND (d.name = ? OR d.description = ? OR d.keywords = ?) ";
        $seachText = $params->documentSearchText;
      }
      
      // add the search text 3 times
      for ($i = 0; $i < 3; $i++)
      {
        $whereParams[] = $seachText;
      }
    }
    
    $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 "
                        . $whereClause
                        . "ORDER BY d.name, d.version_major, d.version_minor, d.version_patch")
                    ->execute($whereParams);
    $arrDocuments = array();
    while ($objDocument->next())
    {
      $document = $this->buildDocument($objDocument);
      $document->category = $category;
      $arrDocuments[$document->id] = $document;
    }
    return $arrDocuments;
  }
private function getDocuments(\Category $category, \DmsLoaderParams $params)
  {
    $whereClause = "WHERE d.pid = ? ";
    
    $whereParams = array();
    $whereParams[] = $category->id;
    
    if ($params->hasDocumentSearchText())
    {
      if ($params->documentSearchType == \DmsLoaderParams::DOCUMENT_SEARCH_LIKE)
      {
        $whereClause .= "AND (UPPER(d.name) LIKE ? OR UPPER(d.description) LIKE ? OR UPPER(d.keywords) LIKE ?) ";
        $seachText = "%" . $params->documentSearchText . "%";
      }
      else
      {
        $whereClause .= "AND (d.name = ? OR d.description = ? OR d.keywords = ?) ";
        $seachText = $params->documentSearchText;
      }
      
      // add the search text 3 times
      for ($i = 0; $i < 3; $i++)
      {
        $whereParams[] = $seachText;
      }
    }
    
    $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 "
                        . $whereClause
                        . "ORDER BY d.name, d.version_major, d.version_minor, d.version_patch")
                    ->execute($whereParams);
    $arrDocuments = array();
    while ($objDocument->next())
    {
      $document = $this->buildDocument($objDocument);
      $document->category = $category;
      $arrDocuments[$document->id] = $document;
    }
    return $arrDocuments;
  }
private function getDocuments ( \ Category $ category , \ DmsLoaderParams $ params ) { $ whereClause = "WHERE d.pid = ? " ; $ whereParams = array ( ) ; $ whereParams [ ] = $ category -> id ; if ( $ params -> hasDocumentSearchText ( ) ) { if ( $ params -> documentSearchType == \ DmsLoaderParams :: DOCUMENT_SEARCH_LIKE ) { $ whereClause .= "AND (UPPER(d.name) LIKE ? OR UPPER(d.description) LIKE ? OR UPPER(d.keywords) LIKE ?) " ; $ seachText = "%" . $ params -> documentSearchText . "%" ; } else { $ whereClause .= "AND (d.name = ? OR d.description = ? OR d.keywords = ?) " ; $ seachText = $ params -> documentSearchText ; } // add the search text 3 times for ( $ i = 0 ; $ i < 3 ; $ i ++ ) { $ whereParams [ ] = $ seachText ; } } $ 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 " . $ whereClause . "ORDER BY d.name, d.version_major, d.version_minor, d.version_patch" ) -> execute ( $ whereParams ) ; $ arrDocuments = array ( ) ; while ( $ objDocument -> next ( ) ) { $ document = $ this -> buildDocument ( $ objDocument ) ; $ document -> category = $ category ; $ arrDocuments [ $ document -> id ] = $ document ; } return $ arrDocuments ; }
Get all documents for the given category.

@param  category  $category  The category to get the access rights for.
@param  DmsLoaderParams  $params  The configured params to use while loading.
@return  arr  Returns array of documents.
Get all documents for the given category .