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 class Mage_Core_Model_Mysql4_Design_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
00029 {
00030 protected function _construct()
00031 {
00032 $this->_init('core/design');
00033 }
00034
00035 public function joinStore(){
00036 $this->getSelect()
00037 ->join(array('s'=>$this->getTable('core/store')), 's.store_id = main_table.store_id', array('s.name'));
00038
00039 return $this;
00040 }
00041
00042 public function addDateFilter($date = null)
00043 {
00044 if (is_null($date))
00045 $date = date("Y-m-d");
00046
00047 $this->getSelect()
00048 ->where('main_table.date_from <= ?', $date)
00049 ->where('main_table.date_to >= ?', $date);
00050
00051 return $this;
00052 }
00053
00054 public function addStoreFilter($storeId)
00055 {
00056 $this->getSelect()
00057 ->where('main_table.store_id IN(?)', $storeId);
00058
00059 return $this;
00060 }
00061 }