0

array_map() expects parameter 1 to be a valid callback, class 'Search' does not have a method 'wishList'

 $shops = array_map(array($this, 'wishList'), $shops);

 function wishList($shops) {
        print_r(shops);
        $this->check_authentication(); 
        $user = $this->getUser();
        $shops->isWishList = $this->Wishlist_model->_isShopInMyWishList($shops->id, $user->id,6) ? true : false;
        return $shops;
    }
dev dev
  • 121
  • 1
  • 2
  • 17

1 Answers1

1

For what I see that's the issue, you just declared your wishList function not in the Search class, if you wanna do this your should write this:

$shops = array_map('wishList', $shops);

Or move you wishList function to your Search class

Gregoire Ducharme
  • 1,095
  • 12
  • 24