|
@@ 192-202 (lines=11) @@
|
| 189 |
|
* @param oledrion_lists $list |
| 190 |
|
* @return boolean |
| 191 |
|
*/ |
| 192 |
|
public function incrementListViews(Oledrion_lists $list) |
| 193 |
|
{ |
| 194 |
|
$res = true; |
| 195 |
|
if (OledrionUtility::getCurrentUserID() != $list->getVar('list_uid')) { |
| 196 |
|
$sql = 'UPDATE ' . $this->table . ' SET list_views = list_views + 1 WHERE list_id = ' . $list->getVar('list_id'); |
| 197 |
|
$res = $this->db->queryF($sql); |
| 198 |
|
$this->forceCacheClean(); |
| 199 |
|
} |
| 200 |
|
|
| 201 |
|
return $res; |
| 202 |
|
} |
| 203 |
|
|
| 204 |
|
/** |
| 205 |
|
* Incrémente le nombre de produits dans une liste |
|
@@ 227-236 (lines=10) @@
|
| 224 |
|
* @param int $value |
| 225 |
|
* @return bool |
| 226 |
|
*/ |
| 227 |
|
public function decrementListProductsCount(Oledrion_lists $list, $value = 1) |
| 228 |
|
{ |
| 229 |
|
$value = (int)$value; |
| 230 |
|
$res = true; |
| 231 |
|
$sql = 'UPDATE ' . $this->table . ' SET list_productscount = list_productscount - $value WHERE list_id = ' . $list->getVar('list_id'); |
| 232 |
|
$res = $this->db->queryF($sql); |
| 233 |
|
$this->forceCacheClean(); |
| 234 |
|
|
| 235 |
|
return $res; |
| 236 |
|
} |
| 237 |
|
|
| 238 |
|
/** |
| 239 |
|
* Retourne la liste des listes récentes |