[ Index ]

PHP Cross Reference of vtigercrm-6.1.0

title

Body

[close]

/modules/HelpDesk/models/ -> Record.php (source)

   1  <?php
   2  /*+***********************************************************************************
   3   * The contents of this file are subject to the vtiger CRM Public License Version 1.0
   4   * ("License"); You may not use this file except in compliance with the License
   5   * The Original Code is:  vtiger CRM Open Source
   6   * The Initial Developer of the Original Code is vtiger.
   7   * Portions created by vtiger are Copyright (C) vtiger.
   8   * All Rights Reserved.
   9   *************************************************************************************/
  10  
  11  class HelpDesk_Record_Model extends Vtiger_Record_Model {
  12  
  13      /**
  14       * Function to get the Display Name for the record
  15       * @return <String> - Entity Display Name for the record
  16       */
  17  	public function getDisplayName() {
  18          return Vtiger_Util_Helper::getLabel($this->getId());
  19      }
  20  
  21      /**
  22       * Function to get URL for Convert FAQ
  23       * @return <String>
  24       */
  25  	public function getConvertFAQUrl() {
  26          return "index.php?module=".$this->getModuleName()."&action=ConvertFAQ&record=".$this->getId();
  27      }
  28  
  29      /**
  30       * Function to get Comments List of this Record
  31       * @return <String>
  32       */
  33  	public function getCommentsList() {
  34          $db = PearDatabase::getInstance();
  35          $commentsList = array();
  36  
  37          $result = $db->pquery("SELECT commentcontent AS comments FROM vtiger_modcomments WHERE related_to = ?", array($this->getId()));
  38          $numOfRows = $db->num_rows($result);
  39  
  40          for ($i=0; $i<$numOfRows; $i++) {
  41              array_push($commentsList, $db->query_result($result, $i, 'comments'));
  42          }
  43  
  44          return $commentsList;
  45      }
  46  }


Generated: Fri Nov 28 20:08:37 2014 Cross-referenced by PHPXref 0.7.1