/**
  * Forces the cache to be cleaned
  */
 function forceCacheClean()
 {
     require_once 'lite.php';
     $Cache_Lite = new oledrion_Cache_Lite($this->cacheOptions);
     $Cache_Lite->clean();
 }
예제 #2
0
 /**
  * Retourne la liste des ID de produits vendus récemment
  *
  * @param integer $start
  * @param integer $limit
  * @return array
  * @since 2.3.2009.04.08
  */
 function getRecentlySoldProducts($start = 0, $limit = 0)
 {
     require_once 'lite.php';
     $ret = array();
     $sql = 'SELECT c.caddy_product_id FROM ' . $this->table . ' c, ' . $this->db->prefix('oledrion_commands') . ' o WHERE (c.caddy_cmd_id = o.cmd_id) AND (o.cmd_state = ' . OLEDRION_STATE_VALIDATED . ') ORDER BY cmd_date DESC';
     $Cache_Lite = new oledrion_Cache_Lite($this->cacheOptions);
     $id = $this->_getIdForCache($sql, $start, $limit);
     $cacheData = $Cache_Lite->get($id);
     if ($cacheData === false) {
         $result = $this->db->query($sql, $limit, $start);
         if ($result) {
             while ($row = $this->db->fetchArray($result)) {
                 $ret[$row['caddy_product_id']] = $row['caddy_product_id'];
             }
         }
         $Cache_Lite->save($ret);
         return $ret;
     } else {
         return $cacheData;
     }
 }
예제 #3
0
 /**
  * Retourne les x dernières listes qui contiennent des produits dans une certaine catégorie
  *
  * @param integer $cateGoryId	L'identifiant de la catégorie
  * @param integer $list_type	Le type de liste
  * @param integer $limit		Le nombre maximum de listes à retourner
  * @return array				Objets de type oledrion_lists, [clé] = id liste
  */
 function listsFromCurrentCategory($categoryId, $list_type, $limit)
 {
     require_once 'lite.php';
     $ret = array();
     $start = 0;
     $categoryId = intval($categoryId);
     $list_type = intval($list_type);
     $limit = intval($limit);
     $sql = 'SELECT distinct(z.productlist_list_id) FROM ' . $this->db->prefix('oledrion_products_list') . ' z, ' . $this->db->prefix('oledrion_products') . ' p, ' . $this->db->prefix('oledrion_lists') . ' l WHERE (l.list_type = ' . $list_type . ') AND (p.product_cid = ' . $categoryId . ') AND (l.list_id = z.productlist_list_id) AND (z.productlist_product_id = p.product_id) AND (p.product_online = 1) ORDER BY l.list_date DESC';
     $Cache_Lite = new oledrion_Cache_Lite($this->cacheOptions);
     $id = $this->_getIdForCache($sql, $start, $limit);
     $cacheData = $Cache_Lite->get($id);
     if ($cacheData === false) {
         $result = $this->db->query($sql, $limit, $start);
         if ($result) {
             while ($row = $this->db->fetchArray($result)) {
                 $ret[] = $row['productlist_list_id'];
             }
             $ret = $this->getItemsFromIds($ret);
         }
         $Cache_Lite->save($ret);
         return $ret;
     } else {
         return $cacheData;
     }
 }