[ Index ]

PHP Cross Reference of vtigercrm-6.1.0

title

Body

[close]

/modules/Vtiger/models/ -> TrackRecord.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  /**
  12   * Vtiger Tracker Record Model Class
  13   */
  14  class Vtiger_TrackRecord_Model extends Vtiger_Record_Model {
  15  
  16      /**
  17       * Function to get the id of the record
  18       * @return <Number> - Record Id
  19       */
  20  	public function getId() {
  21          return $this->get('item_id');
  22      }
  23  
  24      /**
  25       * Function to get the name of the record
  26       * @return <String> - Entity Name of the Record
  27       */
  28  	public function getName() {
  29          return $this->get('item_summary');
  30      }
  31  
  32      /**
  33       * Function to get the instance of the Tracker Record Model from the list of key-value mapping
  34       * @param <Array> $valueMap
  35       * @return Vtiger_TrackRecord_Model instance
  36       */
  37  	public static function getInstance($valueMap) {
  38          $instance = new self();
  39          $instance->setData($valueMap);
  40          $instance->setModule($valueMap['module_name']);
  41          return $instance;
  42      }
  43  
  44      /**
  45       * Function to get all the Tracker records
  46       * @param <Number> $limit - Limit on the number of records
  47       * @return <Array> - List of Vtiger_TrackRecord_Model instances
  48       */
  49  	public static function getAll($limit=null) {
  50          require_once ('data/Tracker.php');
  51          $tracFocus = new Tracker();
  52          $userModel = Users_Record_Model::getCurrentUserModel();
  53          $list = $tracFocus->get_recently_viewed($userModel->getId());
  54          $trackRecords = array();
  55          foreach($list as $record) {
  56              $trackRecords[] = self::getInstance($record);
  57          }
  58          return $trackRecords;
  59      }
  60  }


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