00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 class Mage_Reports_Model_Mysql4_Entity_Summary_Collection_Abstract extends Varien_Data_Collection
00036 {
00037
00038
00039
00040
00041
00042 protected $_entityCollection;
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064 public function setSelectPeriod($periodType, $customStart=null, $customEnd=null)
00065 {
00066 switch ($periodType) {
00067 case "24h":
00068 $customStart = time()-24*60*60;
00069 $customEnd = time();
00070 break;
00071
00072 case "7d":
00073 $customStart = time()-7*24*60*60;
00074 $customEnd = time();
00075 break;
00076
00077 case "30d":
00078 $customStart = time()-30*24*60*60;
00079 $customEnd = time();
00080 break;
00081
00082 case "1y":
00083 $customStart = time()-365*24*60*60;
00084 $customEnd = time();
00085 break;
00086
00087 default:
00088 if(is_string($customStart)) {
00089 $customStart = strtotime($customStart);
00090 }
00091 if(is_string($customEnd)) {
00092 $customEnd = strtotime($customEnd);
00093 }
00094 break;
00095
00096 }
00097
00098
00099 return $this;
00100 }
00101
00102
00103 public function setDatePeriod($period)
00104 {
00105
00106 }
00107
00108 public function setStoreFilter($storeId)
00109 {
00110 return $this;
00111 }
00112
00113
00114
00115
00116
00117
00118 public function getCollection()
00119 {
00120 if (empty($this->_entityCollection)) {
00121 $this->_initCollection();
00122 }
00123 return $this->_entityCollection;
00124 }
00125
00126 protected function _initCollection()
00127 {
00128 return $this;
00129 }
00130
00131 }