• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

Services/Tracking/classes/class.ilLPStatusWrapper.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003         +-----------------------------------------------------------------------------+
00004         | ILIAS open source                                                           |
00005         +-----------------------------------------------------------------------------+
00006         | Copyright (c) 1998-2001 ILIAS open source, University of Cologne            |
00007         |                                                                             |
00008         | This program is free software; you can redistribute it and/or               |
00009         | modify it under the terms of the GNU General Public License                 |
00010         | as published by the Free Software Foundation; either version 2              |
00011         | of the License, or (at your option) any later version.                      |
00012         |                                                                             |
00013         | This program is distributed in the hope that it will be useful,             |
00014         | but WITHOUT ANY WARRANTY; without even the implied warranty of              |
00015         | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               |
00016         | GNU General Public License for more details.                                |
00017         |                                                                             |
00018         | You should have received a copy of the GNU General Public License           |
00019         | along with this program; if not, write to the Free Software                 |
00020         | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. |
00021         +-----------------------------------------------------------------------------+
00022 */
00023 
00038 include_once 'Services/Tracking/classes/class.ilLPObjSettings.php';
00039 include_once 'Services/Tracking/classes/class.ilLPStatusFactory.php';
00040 
00041 class ilLPStatusWrapper
00042 {
00043 
00047         function _getCountNotAttempted($a_obj_id)
00048         {
00049                 return count(ilLPStatusWrapper::_getNotAttempted($a_obj_id));
00050         }
00051 
00055         function _getNotAttempted($a_obj_id)
00056         {
00057                 static $cache = array();
00058 
00059                 if(isset($cache[$a_obj_id]))
00060                 {
00061                         return $cache[$a_obj_id];
00062                 }
00063 
00064                 $class = ilLPStatusFactory::_getClassById($a_obj_id);
00065 
00066                 $cache[$a_obj_id] = call_user_func(array($class,'_getNotAttempted'),$a_obj_id);
00067                 
00068                 return $cache[$a_obj_id];
00069         }
00070 
00074         function _getCountInProgress($a_obj_id)
00075         {
00076                 return count(ilLPStatusWrapper::_getInProgress($a_obj_id));
00077         }
00078 
00082         function _getInProgress($a_obj_id)
00083         {
00084                 static $cache = array();
00085 
00086                 if(isset($cache[$a_obj_id]))
00087                 {
00088                         return $cache[$a_obj_id];
00089                 }
00090 
00091                 global $ilBench;
00092 
00093                 $class = ilLPStatusFactory::_getClassById($a_obj_id);
00094 
00095                 $cache[$a_obj_id] = call_user_func($tmp = array($class,'_getInProgress'),$a_obj_id);
00096 
00097                 return $cache[$a_obj_id];
00098         }
00099         
00103         function _getCountCompleted($a_obj_id)
00104         {
00105                 return count(ilLPStatusWrapper::_getCompleted($a_obj_id));
00106         }
00107 
00111         function _getCompleted($a_obj_id)
00112         {
00113                 static $cache = array();
00114 
00115                 if(isset($cache[$a_obj_id]))
00116                 {
00117                         return $cache[$a_obj_id];
00118                 }
00119 
00120                 $class = ilLPStatusFactory::_getClassById($a_obj_id);
00121 
00122                 $cache[$a_obj_id] = call_user_func(array($class,'_getCompleted'),$a_obj_id);
00123 
00124                 return $cache[$a_obj_id];
00125         }
00126 }       
00127 ?>

Generated on Fri Dec 13 2013 11:57:59 for ILIAS Release_3_6_x_branch .rev 46809 by  doxygen 1.7.1