XoopsModules25x /
oledrion
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 1 | <?php |
||
| 2 | /* |
||
| 3 | You may not change or alter any portion of this comment or credits |
||
| 4 | of supporting developers from this source code or any supporting source code |
||
| 5 | which is considered copyrighted (c) material of the original comment or credit authors. |
||
| 6 | |||
| 7 | This program is distributed in the hope that it will be useful, |
||
| 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
| 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
||
| 10 | */ |
||
| 11 | |||
| 12 | /** |
||
| 13 | * oledrion |
||
| 14 | * |
||
| 15 | * @copyright {@link http://xoops.org/ XOOPS Project} |
||
| 16 | * @license {@link http://www.fsf.org/copyleft/gpl.html GNU public license} |
||
| 17 | * @author Hervé Thouzard (http://www.herve-thouzard.com/) |
||
| 18 | */ |
||
| 19 | /** |
||
| 20 | * Gestion des listes utilisateurs |
||
| 21 | * |
||
| 22 | * @since 2.3.2009.06.13 |
||
| 23 | */ |
||
| 24 | require __DIR__ . '/classheader.php'; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Définition des types de listes |
||
| 28 | */ |
||
| 29 | define('OLEDRION_LISTS_ALL_PUBLIC', -2); // Que les publiques |
||
| 30 | define('OLEDRION_LISTS_ALL', -1); // Toutes sans distinction |
||
| 31 | define('OLEDRION_LISTS_PRIVATE', 0); |
||
| 32 | define('OLEDRION_LISTS_WISH', 1); |
||
| 33 | define('OLEDRION_LISTS_RECOMMEND', 2); |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Class Oledrion_lists |
||
| 37 | */ |
||
| 38 | class Oledrion_lists extends Oledrion_Object |
||
| 39 | { |
||
| 40 | /** |
||
| 41 | * constructor |
||
| 42 | * |
||
| 43 | * normally, this is called from child classes only |
||
| 44 | * |
||
| 45 | * @access public |
||
| 46 | */ |
||
| 47 | public function __construct() |
||
| 48 | { |
||
| 49 | $this->initVar('list_id', XOBJ_DTYPE_INT, null, false); |
||
| 50 | $this->initVar('list_uid', XOBJ_DTYPE_INT, null, false); |
||
| 51 | $this->initVar('list_title', XOBJ_DTYPE_TXTBOX, null, false); |
||
| 52 | $this->initVar('list_date', XOBJ_DTYPE_INT, null, false); |
||
| 53 | $this->initVar('list_productscount', XOBJ_DTYPE_INT, null, false); |
||
| 54 | $this->initVar('list_views', XOBJ_DTYPE_INT, null, false); |
||
| 55 | $this->initVar('list_password', XOBJ_DTYPE_TXTBOX, null, false); |
||
| 56 | $this->initVar('list_type', XOBJ_DTYPE_INT, null, false); |
||
| 57 | $this->initVar('list_description', XOBJ_DTYPE_TXTAREA, null, false); |
||
| 58 | } |
||
| 59 | |||
| 60 | /** |
||
| 61 | * Indique si la liste courante est accessible de l'utilisateur courant |
||
| 62 | * |
||
| 63 | * @return boolean |
||
| 64 | */ |
||
| 65 | public function isSuitableForCurrentUser() |
||
| 66 | { |
||
| 67 | $uid = Oledrion_utils::getCurrentUserID(); |
||
| 68 | if ($this->getVar('list_type') == OLEDRION_LISTS_PRIVATE) { |
||
| 69 | if ($uid == 0 || $uid != $this->getVar('list_uid')) { |
||
| 70 | return false; |
||
| 71 | } |
||
| 72 | } |
||
| 73 | |||
| 74 | return true; |
||
| 75 | } |
||
| 76 | |||
| 77 | /** |
||
| 78 | * Retourne un tableau associatif qui pour chaque type de liste indique son type sous forme de texte |
||
| 79 | * |
||
| 80 | * @return array |
||
| 81 | */ |
||
| 82 | public static function getTypesArray() |
||
| 83 | { |
||
| 84 | return array( |
||
| 85 | OLEDRION_LISTS_PRIVATE => _OLEDRION_LIST_PRIVATE, |
||
| 86 | OLEDRION_LISTS_WISH => _OLEDRION_LIST_PUBLIC_WISH_LIST, |
||
| 87 | OLEDRION_LISTS_RECOMMEND => _OLEDRION_LIST_PUBLIC_RECOMMENDED_LIST |
||
| 88 | ); |
||
| 89 | } |
||
| 90 | |||
| 91 | /** |
||
| 92 | * Retourne la description de la liste courante |
||
| 93 | * |
||
| 94 | * @return string |
||
| 95 | */ |
||
| 96 | public function getListTypeDescription() |
||
| 97 | { |
||
| 98 | $description = static::getTypesArray(); |
||
| 99 | |||
| 100 | return $description[$this->list_type]; |
||
| 101 | } |
||
| 102 | |||
| 103 | /** |
||
| 104 | * Retourne l'url à utiliser pour accéder à la liste en tenant compte des préférences du module |
||
| 105 | * |
||
| 106 | * @return string L'url à utiliser |
||
| 107 | */ |
||
| 108 | View Code Duplication | public function getLink() |
|
| 109 | { |
||
| 110 | $url = ''; |
||
| 111 | if (Oledrion_utils::getModuleOption('urlrewriting') == 1) { // On utilise l'url rewriting |
||
| 112 | $url = OLEDRION_URL . 'list-' . $this->getVar('list_id') . Oledrion_utils::makeSeoUrl($this->getVar('list_title', 'n')) . '.html'; |
||
| 113 | } else { // Pas d'utilisation de l'url rewriting |
||
| 114 | $url = OLEDRION_URL . 'list.php?list_id=' . $this->getVar('list_id'); |
||
| 115 | } |
||
| 116 | |||
| 117 | return $url; |
||
| 118 | } |
||
| 119 | |||
| 120 | /** |
||
| 121 | * Retourne la date de création de la liste formatée |
||
| 122 | * |
||
| 123 | * @param string $format |
||
| 124 | * @return string |
||
| 125 | */ |
||
| 126 | public function getFormatedDate($format = 's') |
||
| 127 | { |
||
| 128 | return formatTimestamp($this->list_date, $format); |
||
| 129 | } |
||
| 130 | |||
| 131 | /** |
||
| 132 | * Rentourne la chaine à utiliser dans une balise <a> pour l'attribut href |
||
| 133 | * |
||
| 134 | * @return string |
||
| 135 | */ |
||
| 136 | public function getHrefTitle() |
||
| 137 | { |
||
| 138 | return Oledrion_utils::makeHrefTitle($this->getVar('list_title')); |
||
| 139 | } |
||
| 140 | |||
| 141 | /** |
||
| 142 | * Retourne le nom de l'auteur de la liste courante |
||
| 143 | * |
||
| 144 | * @return string |
||
| 145 | */ |
||
| 146 | public function getListAuthorName() |
||
| 147 | { |
||
| 148 | return XoopsUser::getUnameFromId($this->getVar('list_uid', true)); |
||
| 149 | } |
||
| 150 | |||
| 151 | /** |
||
| 152 | * Retourne les éléments formatés pour affichage (en général) |
||
| 153 | * |
||
| 154 | * @param string $format |
||
| 155 | * @return array |
||
| 156 | */ |
||
| 157 | public function toArray($format = 's') |
||
| 158 | { |
||
| 159 | $ret = array(); |
||
| 160 | $ret = parent::toArray($format); |
||
| 161 | $ret['list_type_description'] = $this->getListTypeDescription(); |
||
| 162 | $ret['list_href_title'] = $this->getHrefTitle(); |
||
| 163 | $ret['list_url_rewrited'] = $this->getLink(); |
||
| 164 | $ret['list_formated_date'] = $this->getFormatedDate(); |
||
| 165 | $ret['list_username'] = $this->getListAuthorName(); |
||
| 166 | $ret['list_formated_count'] = sprintf(_OLEDRION_PRODUCTS_COUNT, $this->getVar('list_productscount')); |
||
| 167 | |||
| 168 | return $ret; |
||
| 169 | } |
||
| 170 | } |
||
| 171 | |||
| 172 | /** |
||
| 173 | * Class OledrionOledrion_listsHandler |
||
| 174 | */ |
||
| 175 | class OledrionOledrion_listsHandler extends Oledrion_XoopsPersistableObjectHandler |
||
| 176 | { |
||
| 177 | /** |
||
| 178 | * OledrionOledrion_listsHandler constructor. |
||
| 179 | * @param XoopsDatabase|null $db |
||
| 180 | */ |
||
| 181 | public function __construct(XoopsDatabase $db) |
||
| 182 | { // Table Classe Id Identifiant |
||
| 183 | parent::__construct($db, 'oledrion_lists', 'oledrion_lists', 'list_id', 'list_title'); |
||
| 184 | } |
||
| 185 | |||
| 186 | /** |
||
| 187 | * Incrémente le compteur de vues d'une liste |
||
| 188 | * |
||
| 189 | * @param oledrion_lists $list |
||
| 190 | * @return boolean |
||
| 191 | */ |
||
| 192 | public function incrementListViews(Oledrion_lists $list) |
||
| 193 | { |
||
| 194 | $res = true; |
||
| 195 | if (Oledrion_utils::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 |
||
| 206 | * |
||
| 207 | * @param oledrion_lists $list |
||
| 208 | * @return boolean |
||
| 209 | */ |
||
| 210 | public function incrementListProductsCount(Oledrion_lists $list) |
||
| 211 | { |
||
| 212 | $res = true; |
||
| 213 | $sql = 'UPDATE ' . $this->table . ' SET list_productscount = list_productscount + 1 WHERE list_id = ' . $list->getVar('list_id'); |
||
| 214 | $res = $this->db->queryF($sql); |
||
| 215 | $this->forceCacheClean(); |
||
| 216 | |||
| 217 | return $res; |
||
| 218 | } |
||
| 219 | |||
| 220 | /** |
||
| 221 | * Décrémente le nombre de produits dans une liste |
||
| 222 | * |
||
| 223 | * @param oledrion_lists $list |
||
| 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 |
||
| 240 | * |
||
| 241 | * @param Oledrion_parameters $parameters |
||
| 242 | * @return array Tableau d'objets de type oledrion_lists [clé] = id liste |
||
| 243 | * @internal param int $start |
||
| 244 | * @internal param int $limit |
||
| 245 | * @internal param string $sort |
||
| 246 | * @internal param string $order |
||
| 247 | * @internal param bool $idAsKey |
||
| 248 | * @internal param int $listType |
||
| 249 | * @internal param int $list_uid |
||
| 250 | */ |
||
| 251 | public function getRecentLists(Oledrion_parameters $parameters) |
||
| 252 | { |
||
| 253 | $parameters = $parameters->extend(new Oledrion_parameters(array( |
||
|
0 ignored issues
–
show
|
|||
| 254 | 'start' => 0, |
||
| 255 | 'limit' => 0, |
||
| 256 | 'sort' => 'list_date', |
||
| 257 | 'order' => 'DESC', |
||
| 258 | 'idAsKey' => true, |
||
| 259 | 'listType' => OLEDRION_LISTS_ALL, |
||
| 260 | 'list_uid' => 0 |
||
| 261 | ))); |
||
| 262 | $criteria = new CriteriaCompo(); |
||
| 263 | View Code Duplication | switch ($parameters['listType']) { |
|
| 264 | case OLEDRION_LISTS_ALL: |
||
| 265 | $criteria->add(new Criteria('list_id', 0, '<>')); |
||
| 266 | break; |
||
| 267 | case OLEDRION_LISTS_ALL_PUBLIC: |
||
| 268 | $criteria->add(new Criteria('list_type', OLEDRION_LISTS_WISH, '=')); |
||
| 269 | $criteria->add(new Criteria('list_type', OLEDRION_LISTS_RECOMMEND, '='), 'OR'); |
||
| 270 | break; |
||
| 271 | default: |
||
| 272 | $criteria->add(new Criteria('list_type', $parameters['listType'], '=')); |
||
| 273 | break; |
||
| 274 | } |
||
| 275 | if ($parameters['list_uid'] > 0) { |
||
| 276 | $criteria->add(new Criteria('list_uid', $parameters['list_uid'], '=')); |
||
| 277 | } |
||
| 278 | $criteria->setSort($parameters['sort']); |
||
| 279 | $criteria->setOrder($parameters['order']); |
||
| 280 | $criteria->setStart($parameters['start']); |
||
| 281 | $criteria->setLimit($parameters['limit']); |
||
| 282 | |||
| 283 | return $this->getObjects($criteria, $parameters['idAsKey']); |
||
| 284 | } |
||
| 285 | |||
| 286 | /** |
||
| 287 | * Retourne le nombre de listes d'un certain type |
||
| 288 | * |
||
| 289 | * @param integer $listType |
||
| 290 | * @param integer $list_uid |
||
| 291 | * @return integer |
||
| 292 | */ |
||
| 293 | public function getRecentListsCount($listType = OLEDRION_LISTS_ALL, $list_uid = 0) |
||
| 294 | { |
||
| 295 | $criteria = new CriteriaCompo(); |
||
| 296 | View Code Duplication | switch ($listType) { |
|
| 297 | case OLEDRION_LISTS_ALL: |
||
| 298 | $criteria->add(new Criteria('list_id', 0, '<>')); |
||
| 299 | break; |
||
| 300 | case OLEDRION_LISTS_ALL_PUBLIC: |
||
| 301 | $criteria->add(new Criteria('list_type', OLEDRION_LISTS_WISH, '=')); |
||
| 302 | $criteria->add(new Criteria('list_type', OLEDRION_LISTS_RECOMMEND, '='), 'OR'); |
||
| 303 | break; |
||
| 304 | default: |
||
| 305 | $criteria->add(new Criteria('list_type', $listType, '=')); |
||
| 306 | break; |
||
| 307 | } |
||
| 308 | if ($list_uid > 0) { |
||
| 309 | $criteria->add(new Criteria('list_uid', $list_uid, '=')); |
||
| 310 | } |
||
| 311 | |||
| 312 | return $this->getCount($criteria); |
||
| 313 | } |
||
| 314 | |||
| 315 | /** |
||
| 316 | * Retourne une liste d'utilisateurs Xoops en fonction d'une liste de listes |
||
| 317 | * |
||
| 318 | * @param array $oledrion_lists |
||
| 319 | * @return array [clé] = id utilisateur |
||
| 320 | */ |
||
| 321 | public function getUsersFromLists($oledrion_lists) |
||
| 322 | { |
||
| 323 | $usersList = array(); |
||
| 324 | foreach ($oledrion_lists as $list) { |
||
| 325 | $usersList[] = $list->list_uid; |
||
| 326 | } |
||
| 327 | if (count($usersList) > 0) { |
||
| 328 | return Oledrion_utils::getUsersFromIds($usersList); |
||
| 329 | } else { |
||
| 330 | return array(); |
||
| 331 | } |
||
| 332 | } |
||
| 333 | |||
| 334 | /** |
||
| 335 | * Suppression d'une liste (et des produits qui lui sont rattachés) |
||
| 336 | * |
||
| 337 | * @param oledrion_lists $list |
||
| 338 | * @return boolean |
||
| 339 | */ |
||
| 340 | public function deleteList(Oledrion_lists $list) |
||
| 341 | { |
||
| 342 | $handlers = OledrionHandler::getInstance(); |
||
| 343 | $handlers->h_oledrion_products_list->deleteListProducts($list); |
||
| 344 | |||
| 345 | return $this->delete($list, true); |
||
| 346 | } |
||
| 347 | |||
| 348 | /** |
||
| 349 | * Retourne les produits d'une liste |
||
| 350 | * |
||
| 351 | * @param oledrion_lists $list |
||
| 352 | * @return array Objets de type oledrion_products |
||
| 353 | */ |
||
| 354 | public function getListProducts(Oledrion_lists $list) |
||
| 355 | { |
||
| 356 | $productsInList = $ret = $productsIds = array(); |
||
| 357 | $handlers = OledrionHandler::getInstance(); |
||
| 358 | $productsInList = $handlers->h_oledrion_products_list->getProductsFromList($list); |
||
| 359 | if (count($productsInList) == 0) { |
||
| 360 | return $ret; |
||
| 361 | } |
||
| 362 | foreach ($productsInList as $product) { |
||
| 363 | $productsIds[] = $product->getVar('productlist_product_id'); |
||
| 364 | } |
||
| 365 | if (count($productsIds) > 0) { |
||
| 366 | $ret = $handlers->h_oledrion_products->getProductsFromIDs($productsIds); |
||
| 367 | } |
||
| 368 | |||
| 369 | return $ret; |
||
| 370 | } |
||
| 371 | |||
| 372 | /** |
||
| 373 | * Indique si une liste appartient bien à un utilisateur |
||
| 374 | * |
||
| 375 | * @param integer $list_id |
||
| 376 | * @param integer $list_uid |
||
| 377 | * @return boolean |
||
| 378 | */ |
||
| 379 | public function isThisMyList($list_id, $list_uid = 0) |
||
| 380 | { |
||
| 381 | if ($list_uid == 0) { |
||
| 382 | $list_uid = Oledrion_utils::getCurrentUserID(); |
||
| 383 | } |
||
| 384 | $list = null; |
||
| 385 | $list = $this->get((int)$list_id); |
||
| 386 | if (!is_object($list)) { |
||
| 387 | return false; |
||
| 388 | } |
||
| 389 | if ($list->getVar('list_uid') == $list_uid) { |
||
| 390 | return true; |
||
| 391 | } else { |
||
| 392 | return false; |
||
| 393 | } |
||
| 394 | } |
||
| 395 | |||
| 396 | /** |
||
| 397 | * Indique si un produit est dans une liste d'un utilisateur |
||
| 398 | * |
||
| 399 | * @param integer $productlist_product_id |
||
| 400 | * @param integer $list_uid |
||
| 401 | * @return boolean |
||
| 402 | */ |
||
| 403 | public function isProductInUserList($productlist_product_id, $list_uid = 0) |
||
| 404 | { |
||
| 405 | //require_once __DIR__ . '/lite.php'; |
||
|
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
50% of this comment could be valid code. Did you maybe forget this after debugging?
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it. The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production. This check looks for comments that seem to be mostly valid code and reports them. Loading history...
|
|||
| 406 | if ($list_uid == 0) { |
||
| 407 | $list_uid = Oledrion_utils::getCurrentUserID(); |
||
| 408 | } |
||
| 409 | if ($list_uid == 0) { |
||
| 410 | return true; |
||
| 411 | } |
||
| 412 | $ret = false; |
||
| 413 | $start = $limit = 0; |
||
| 414 | $list_uid = (int)$list_uid; |
||
| 415 | $productlist_product_id = (int)$productlist_product_id; |
||
| 416 | $sql = 'SELECT Count(*) FROM ' . $this->table . ' l, ' . $this->db->prefix('oledrion_products_list') . ' p WHERE (p.productlist_list_id = l.list_id) AND (l.list_uid = ' . $list_uid . ') AND (p.productlist_product_id =' |
||
| 417 | . $productlist_product_id . ')'; |
||
| 418 | //$Cache_Lite = new oledrion_Cache_Lite($this->cacheOptions); |
||
| 419 | $id = $this->_getIdForCache($sql, $start, $limit); |
||
| 420 | //$cacheData = $Cache_Lite->get($id); |
||
| 421 | //if ($cacheData === false) { |
||
| 422 | $result = $this->db->query($sql, $limit, $start); |
||
| 423 | if ($result) { |
||
| 424 | list($count) = $this->db->fetchRow($result); |
||
| 425 | if ($count > 0) { |
||
| 426 | $ret = true; |
||
| 427 | } |
||
| 428 | } |
||
| 429 | |||
| 430 | //$Cache_Lite->save($ret); |
||
| 431 | return $ret; |
||
| 432 | //} else { |
||
| 433 | //return $cacheData; |
||
| 434 | //} |
||
| 435 | } |
||
| 436 | |||
| 437 | /** |
||
| 438 | * Retourne les x dernières listes qui contiennent des produits dans une certaine catégorie |
||
| 439 | * |
||
| 440 | * @param $categoryId |
||
| 441 | * @param integer $list_type Le type de liste |
||
| 442 | * @param integer $limit Le nombre maximum de listes à retourner |
||
| 443 | * @return array Objets de type oledrion_lists, [clé] = id liste |
||
| 444 | * @internal param int $cateGoryId L'identifiant de la catégorie |
||
| 445 | */ |
||
| 446 | public function listsFromCurrentCategory($categoryId, $list_type, $limit) |
||
| 447 | { |
||
| 448 | //require_once __DIR__ . '/lite.php'; |
||
|
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
50% of this comment could be valid code. Did you maybe forget this after debugging?
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it. The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production. This check looks for comments that seem to be mostly valid code and reports them. Loading history...
|
|||
| 449 | $ret = array(); |
||
| 450 | $start = 0; |
||
| 451 | $categoryId = (int)$categoryId; |
||
| 452 | $list_type = (int)$list_type; |
||
| 453 | $limit = (int)$limit; |
||
| 454 | $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 = ' |
||
| 455 | . $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'; |
||
| 456 | //$Cache_Lite = new oledrion_Cache_Lite($this->cacheOptions); |
||
| 457 | $id = $this->_getIdForCache($sql, $start, $limit); |
||
|
0 ignored issues
–
show
$id is not used, you could remove the assignment.
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently. $myVar = 'Value';
$higher = false;
if (rand(1, 6) > 3) {
$higher = true;
} else {
$higher = false;
}
Both the Loading history...
|
|||
| 458 | //$cacheData = $Cache_Lite->get($id); |
||
| 459 | //if ($cacheData === false) { |
||
| 460 | $result = $this->db->query($sql, $limit, $start); |
||
| 461 | if ($result) { |
||
| 462 | while ($row = $this->db->fetchArray($result)) { |
||
| 463 | $ret[] = $row['productlist_list_id']; |
||
| 464 | } |
||
| 465 | $ret = $this->getItemsFromIds($ret); |
||
| 466 | } |
||
| 467 | |||
| 468 | //$Cache_Lite->save($ret); |
||
| 469 | return $ret; |
||
| 470 | //} else { |
||
| 471 | // return $cacheData; |
||
| 472 | //} |
||
| 473 | } |
||
| 474 | } |
||
| 475 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: